Edit this topic

Markdown text flavor

: shell

: text-flavor

: markdown

: /modules/core/markdown/services/markdown-text-flavor.js

: https://github.com/DecentCMS/DecentCMS/blob/master/modules/core/markdown/services/markdown-text-flavor.js

class: MarkdownFlavor

new MarkdownFlavor(scope, options)

Markdown text field flavor

Param Type Description
scope
options
[options.gfm] boolean Enable GitHub-flavored Markdown.
[options.tables] boolean Enable GFM tables.
[options.breaks] boolean Enable GFM line breaks.
[options.pedantic] boolean Conform to markdown.pl, bugs included.
[options.sanitize] boolean Sanitize the output.
[options.smartLists] boolean Smarter list behavior.
[options.smartyPants] boolean Use smart typographic punctuation.

markdownFlavor.matches(flavor) ⇒ boolean

Matches if the flavor is 'md' or 'markdown'.

Returns: boolean - true if the flavor is md or markdown.

Param Type Description
flavor string The flavor to match.

markdownFlavor.getHtml(markdown) ⇒ string

Transforms the markdown code into HTML.

Returns: string - The HTML.

Param Type Description
markdown string The Markdown code.