Created
June 26, 2020 09:42
-
-
Save bjoerntx/01730a6c67196cd675b1b20057da5c1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class TextControlExtensions | |
{ | |
public static void LoadMarkdown(this TXTextControl.TextControl textControl, | |
string markdown) | |
{ | |
textControl.Load(ParseMarkdown(markdown), TXTextControl.StringStreamType.HTMLFormat); | |
} | |
private static string ParseMarkdown(string markdownInput) | |
{ | |
var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build(); | |
return Markdown.ToHtml(markdownInput, pipeline); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment