MarkdownGfmDataProcessor
This data processor implementation uses GitHub Flavored Markdown as input/output data.
See the Markdown output guide to learn more on how to enable it.
Properties
-
_html2markdown : MarkdownGfmHtmlToMd
privatemodule:markdown-gfm/gfmdataprocessor~MarkdownGfmDataProcessor#_html2markdown
Helper for converting HTML to Markdown.
-
_htmlDP : HtmlDataProcessor
privatemodule:markdown-gfm/gfmdataprocessor~MarkdownGfmDataProcessor#_htmlDP
HTML data processor used to process HTML produced by the Markdown-to-HTML converter and the other way.
-
_markdown2html : MarkdownGfmMdToHtml
privatemodule:markdown-gfm/gfmdataprocessor~MarkdownGfmDataProcessor#_markdown2html
Helper for converting Markdown to HTML.
Methods
-
constructor( document )
module:markdown-gfm/gfmdataprocessor~MarkdownGfmDataProcessor#constructor
-
keepHtml( element ) → void
module:markdown-gfm/gfmdataprocessor~MarkdownGfmDataProcessor#keepHtml
Keeps the specified element in the output as HTML. This is useful if the editor contains features producing HTML that is not a part of the Markdown standard.
By default, all HTML tags are removed.
Parameters
element : keyof HTMLElementTagNameMap
The element name to be kept.
Returns
void
-
registerRawContentMatcher( pattern ) → void
module:markdown-gfm/gfmdataprocessor~MarkdownGfmDataProcessor#registerRawContentMatcher
Registers a
MatcherPattern
for view elements whose content should be treated as raw data and not processed during the conversion from Markdown to view elements.The raw data can be later accessed by a custom property of a view element called
"$rawContent"
.Parameters
pattern : MatcherPattern
The pattern matching all view elements whose content should be treated as raw data.
Returns
void
-
toData( viewFragment ) → string
module:markdown-gfm/gfmdataprocessor~MarkdownGfmDataProcessor#toData
Converts the provided
ViewDocumentFragment
to data format – in this case to a Markdown string.Parameters
viewFragment : ViewDocumentFragment
Returns
string
Markdown string.
-
toView( data ) → ViewDocumentFragment
module:markdown-gfm/gfmdataprocessor~MarkdownGfmDataProcessor#toView
Converts the provided Markdown string to a view tree.
Parameters
data : string
A Markdown string.
Returns
ViewDocumentFragment
The converted view element.
-
useFillerType() → void
module:markdown-gfm/gfmdataprocessor~MarkdownGfmDataProcessor#useFillerType
This method does not have any effect on the data processor result. It exists for compatibility with the
DataProcessor
interface.Returns
void