GFMDataProcessor (markdown-gfm)
@ckeditor/ckeditor5-markdown-gfm/src/gfmdataprocessor
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.
Filtering
Properties
-
private
_html2markdown : HtmlToMarkdownmodule:markdown-gfm/gfmdataprocessor~GFMDataProcessor#_html2markdownHelper for converting HTML to Markdown.
-
HTML data processor used to process HTML produced by the Markdown-to-HTML converter and the other way.
-
private
_markdown2html : MarkdownToHtmlmodule:markdown-gfm/gfmdataprocessor~GFMDataProcessor#_markdown2htmlHelper for converting Markdown to HTML.
Methods
-
constructor( document )module:markdown-gfm/gfmdataprocessor~GFMDataProcessor#constructor -
keepHtml( element ) → voidmodule:markdown-gfm/gfmdataprocessor~GFMDataProcessor#keepHtmlKeeps 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 HTMLElementTagNameMapThe element name to be kept.
Returns
void
-
registerRawContentMatcher( pattern ) → voidmodule:markdown-gfm/gfmdataprocessor~GFMDataProcessor#registerRawContentMatcherRegisters a
MatcherPatternfor 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 : MatcherPatternThe pattern matching all view elements whose content should be treated as raw data.
Returns
void
-
toData( viewFragment ) → stringmodule:markdown-gfm/gfmdataprocessor~GFMDataProcessor#toDataConverts the provided
DocumentFragmentto data format – in this case to a Markdown string.Parameters
viewFragment : DocumentFragment
Returns
stringMarkdown string.
-
toView( data ) → DocumentFragmentmodule:markdown-gfm/gfmdataprocessor~GFMDataProcessor#toViewConverts the provided Markdown string to a view tree.
Parameters
data : stringA Markdown string.
Returns
DocumentFragmentThe converted view element.
-
useFillerType() → voidmodule:markdown-gfm/gfmdataprocessor~GFMDataProcessor#useFillerTypeThis method does not have any effect on the data processor result. It exists for compatibility with the
DataProcessorinterface.Returns
void
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.
With the release of version 42.0.0, we have rewritten much of our documentation to reflect the new import paths and features. We appreciate your feedback to help us ensure its accuracy and completeness.