Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript > Update example to use onProcessMarkdown #339

Merged
merged 1 commit into from
Nov 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions AdaptiveCards/sdk/rendering-cards/javascript/render-a-card.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Render a card - JavaScript SDK
author: matthidinger
ms.author: mahiding
ms.date: 11/28/2017
ms.date: 08/30/2020
ms.topic: article
---

Expand Down Expand Up @@ -76,7 +76,10 @@ adaptiveCard.onExecuteAction = function(action) { alert("Ow!"); }
// E.g., to use markdown-it, include in your HTML page:
// <script type="text/javascript" src="https://unpkg.com/markdown-it/dist/markdown-it.js"></script>
// And add this code to replace the default markdown handler:
// AdaptiveCards.processMarkdown = function(text) { return markdownit().render(text); }
// AdaptiveCards.AdaptiveCard.onProcessMarkdown = function (text, result) {
// result.outputHtml = markdownit().render(text);
// result.didProcess = true;
// };

// Parse the card payload
adaptiveCard.parse(card);
Expand Down