# MarkdownGfmDataProcessor

class

This data processor implementation uses GitHub Flavored Markdown as input/output data.

See the [Markdown output](../features/markdown.md) guide to learn more on how to enable it.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-markdown-gfm/src/gfmdataprocessor.ts#L26)

<a id="properties">

## Properties

<a id="member-_html2markdown">

### `_html2markdown: MarkdownGfmHtmlToMd` _(private)_

Helper for converting HTML to Markdown.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-markdown-gfm/src/gfmdataprocessor.ts#L40)

<a id="member-_htmlDP">

### `_htmlDP: HtmlDataProcessor` _(private)_

HTML data processor used to process HTML produced by the Markdown-to-HTML converter and the other way.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-markdown-gfm/src/gfmdataprocessor.ts#L30)

<a id="member-_markdown2html">

### `_markdown2html: MarkdownGfmMdToHtml` _(private)_

Helper for converting Markdown to HTML.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-markdown-gfm/src/gfmdataprocessor.ts#L35)

<a id="methods">

## Methods

<a id="function-constructor">

### `constructor( document )`

Creates a new instance of the Markdown data processor class.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-markdown-gfm/src/gfmdataprocessor.ts#L45)

#### Parameters

* `document: ViewDocument`

<a id="function-keepHtml">

### `keepHtml( element ) → void`

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.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-markdown-gfm/src/gfmdataprocessor.ts#L59)

#### Parameters

* `element: keyof HTMLElementTagNameMap`

  The element name to be kept.

#### Returns

* `void`

<a id="function-registerRawContentMatcher">

### `registerRawContentMatcher( pattern ) → void`

Registers a [`MatcherPattern`](module_engine_view_matcher-MatcherPattern.md) 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](module_engine_view_element-ViewElement.md#function-getCustomProperty) called `"$rawContent"`.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-markdown-gfm/src/gfmdataprocessor.ts#L95)

#### Parameters

* `pattern: MatcherPattern`

  The pattern matching all view elements whose content should be treated as raw data.

#### Returns

* `void`

<a id="function-toData">

### `toData( viewFragment ) → string`

Converts the provided [`ViewDocumentFragment`](module_engine_view_documentfragment-ViewDocumentFragment.md) to data format – in this case to a Markdown string.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-markdown-gfm/src/gfmdataprocessor.ts#L80)

#### Parameters

* `viewFragment: ViewDocumentFragment`

#### Returns

* `string`

  Markdown string.

<a id="function-toView">

### `toView( data ) → ViewDocumentFragment`

Converts the provided Markdown string to a view tree.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-markdown-gfm/src/gfmdataprocessor.ts#L69)

#### Parameters

* `data: string`

  A Markdown string.

#### Returns

* `ViewDocumentFragment`

  The converted view element.

<a id="function-useFillerType">

### `useFillerType() → void`

This method does not have any effect on the data processor result. It exists for compatibility with the [`DataProcessor` interface](module_engine_dataprocessor_dataprocessor-DataProcessor.md).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-markdown-gfm/src/gfmdataprocessor.ts#L103)

#### Returns

* `void`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
