Edit this topic

Markdown text flavor

: shell

: markdown

: text-flavor

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

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


Kind: global class

new MarkdownFlavor(scope, options)

Markdown text field flavor

Param Type Description
[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'.

Kind: instance method of MarkdownFlavor
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.

Kind: instance method of MarkdownFlavor
Returns: string - The HTML.

Param Type Description
markdown string The Markdown code.