Parse Markdown to HTML using cmark-gfm, GitHub's implementation of Markdown with extensions for tables, strikethrough, etc. For details on the meaning of the various options, refer to GitHub's Markdown documentation.

Example

let inputString = "# Header\n\nMy **markdown** text";
let md = new GitHubMarkdown();

let outputString = md.render(inputString);

Hierarchy

  • GitHubMarkdown

Constructors

Deprecated Properties

noImages: boolean

Deprecated

No longer valid with CMark implementation.

noLinks: boolean

Deprecated

No longer valid with CMark implementation.

removeHTMLTags: boolean

Deprecated

No longer valid with CMark implementation.

safeLinks: boolean

Deprecated

No longer valid with CMark implementation.

smartQuotesEnabled: boolean

Deprecated

No longer valid with CMark implementation

strict: boolean

Deprecated

No longer valid with CMark implementation.

Extensions Properties

autoLinks: boolean

Enables expansion of certain partial URLs. Defaults: true

strikethrough: boolean

Support ~~strikethrough~~ markup. Defaults: true

tables: boolean

Parse Markdown tables. Defaults: true

tagFilters: boolean

Disallows certain HTML tags. Defaults: false

taskLists: boolean

Support [ ] task lists. Default: true

Options Properties

footnotes: boolean

Support Markdown Footnotes. Default: true

hardBreaks: boolean

Render softbreak elements as hard line breaks. Default: false

safe: boolean

Suppress raw HTML and unsafe links. Default: true

smartQuotes: boolean

Convert straight quotes to curly, --- to em dashes, -- to en dashes. Default: true

sourcePOS: boolean

Include a data-sourcepos attribute on all block elements. Default: false

unsafe: boolean

Render "dangerous" HTML and unsafe links. Default: false

validateUTF8: boolean

Validate UTF-8 before parsing, replacing illegal sequences. Default: false

Methods

  • Takes Markdown string passed and processes it with GitHub Markdown parser based on the property selections on the object.

    Parameters

    • markdownStr: string

    Returns string

Generated using TypeDoc