Class MarkdownParser

This class parses Markdown text to HTML. Markdown is a common text format used by many developer Web sites and CMSs to allow formatted text entry using a simple text format that allows specifying of HTML formatting via simple character sequences.

For more info on Markdown please visit the Markdown Syntax Documenation or check out a summary.

Usage is simple:

Load dependencies (in startup code)
DO MarkdownParser
Using the Markdown Helper function
Markdown("### Markdown Topic" + CHR(13) +;
         "Hello **Markdown** World.")
*** <h3>Markdown Topic</h3>
*** <p>Hello <strong>Markdown</strong> World.</p>
Explicitly using the Markdown Parser Object
loParser = CREATEOBJECT("MarkdownParser")
lcHtml = loParser.Parse(lcMarkdownText)

There's also an extended MarkdownParserExtended class which provides additional features for HTML code snippet formatting and expansion of font-awesome icons.

loParser = CREATEOBJECT("MarkdownParserExtended")
loParser.cCodeBlockStartHtml = [<pre lang="###language###">] + CRLF
loParser.cCodeBlockEndHtml = [</pre>]
lcHtml = loParser.Parse(lcMarkdownText)

Remarks

Distribution dependencies:

  • wwdotnetbridge.dll
  • wwipstuff.dll
  • commonmark.dll

Class Members

MemberDescription

Markdown (global function)

o.MarkdownParser.Markdown(lcMarkdown,lnMode,lnReload)

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)

Requirements

Assembly: markdownparser.prg

See also:

Class MarkdownParser | Class MarkdownParserExtended

© West Wind Technologies, 1996-2018 • Updated: 05/20/16
Comment or report problem with topic