This class and the Markdown()
helper function, provide Markdown parsing for converting Markdown text to HTML.
In it's simplest for you can do:
DO MarkdownParser && Load Library (once)
lcMarkdown = "This is **bold** text and this is [linked](https://west-wind.com)."
lcHtml = Markdown(lcMarkdown)
The helper function is the preferred way to use the Markdown parser as it caches the Markdown parser rather than recreating the Markdown processing pipeline for each request.
Alternately you can explicitly use the MarkdownParser
or MarkdownParserExtended
classes, which give a little more control over various options:
lcMarkdown = "This is **bold** text and this is [linked](https://west-wind.com)."
loParser = CREATEOBJECT("MarkdownParser")
loParser.lSanitizeHtml = .T.
llUtf8 = .T. && encode markdown to UTF8 before sending to Parser
loParser.Parse(lcMarkdown,llUtf8)
MarkdownParser
Remarks
Distribution dependencies:
- wwdotnetbridge.dll
- wwipstuff.dll
- markdig.dll
Class Members
Member | Description | |
---|---|---|
CreateParser |
o.CreateParser() |
|
Markdown (global function) |
o.MarkdownParser.Markdown(lcMarkdown,lnMode, llReload,llUtf8, llNoSanitizeHtml, llNoHtmlAllowed) |
|
Parse |
Parses a Markdown text string to HTML using the CommonMark specification. Markdown is parsed in basic format with no additional fixups. o.Parse(lcMarkdownText, llUtf8) |
|
lEncodeScriptBlocks |
If .T. handles |
|
lNoHtmlAllowed |
If |
|
lSanitizeHtml |
If |
Requirements
Assembly: markdownparser.prgSee also:
Class MarkdownParser | Class MarkdownParserExtended© West Wind Technologies, 1996-2022 • Updated: 03/24/19
Comment or report problem with topic