HtmlPageDataProcessor (html-support)
@ckeditor/ckeditor5-html-support/src/htmlpagedataprocessor
The full page HTML data processor class. This data processor implementation uses HTML as input and output data.
Filtering
Properties
-
inherited
domConverter : DomConverter
module:html-support/htmlpagedataprocessor~HtmlPageDataProcessor#domConverter
A DOM converter used to convert DOM elements to view elements.
-
inherited
domParser : DOMParser
module:html-support/htmlpagedataprocessor~HtmlPageDataProcessor#domParser
A DOM parser instance used to parse an HTML string to an HTML document.
-
inherited
htmlWriter : HtmlWriter
module:html-support/htmlpagedataprocessor~HtmlPageDataProcessor#htmlWriter
A basic HTML writer instance used to convert DOM elements to an HTML string.
-
inherited
skipComments : boolean
module:html-support/htmlpagedataprocessor~HtmlPageDataProcessor#skipComments
If
false
, comment nodes will be converted to$comment
. Otherwise comment nodes are ignored.
Methods
-
inherited
constructor( document )
module:html-support/htmlpagedataprocessor~HtmlPageDataProcessor#constructor
Creates a new instance of the HTML data processor class.
Parameters
document : Document
The view document instance.
-
inherited
registerRawContentMatcher( pattern ) → void
module:html-support/htmlpagedataprocessor~HtmlPageDataProcessor#registerRawContentMatcher
Registers a
MatcherPattern
for view elements whose content should be treated as raw data and not processed during the conversion from the DOM to the view elements.The raw data can be later accessed by a custom property of a view element called
"$rawContent"
.Parameters
pattern : MatcherPattern
Pattern matching all view elements whose content should be treated as raw data.
Returns
void
-
toData( viewFragment ) → string
module:html-support/htmlpagedataprocessor~HtmlPageDataProcessor#toData
Converts a provided document fragment to data format – in this case to an HTML string.
Parameters
viewFragment : DocumentFragment
Returns
string
HTML string.
-
toView( data ) → DocumentFragment
module:html-support/htmlpagedataprocessor~HtmlPageDataProcessor#toView
Converts the provided HTML string to a view tree.
Parameters
data : string
An HTML string.
Returns
DocumentFragment
A converted view element.
-
inherited
useFillerType( type ) → void
module:html-support/htmlpagedataprocessor~HtmlPageDataProcessor#useFillerType
If the processor is set to use marked fillers, it will insert
fillers wrapped in<span>
elements (<span data-cke-filler="true"> </span>
) instead of regular
characters.This mode allows for a more precise handling of the block fillers (so they do not leak into the editor content) but bloats the editor data with additional markup.
This mode may be required by some features and will be turned on by them automatically.
Parameters
type : 'default' | 'marked'
Whether to use the default or the marked
block fillers.
Returns
void
-
protected inherited
_toDom( data ) → DocumentFragment
module:html-support/htmlpagedataprocessor~HtmlPageDataProcessor#_toDom
Converts an HTML string to its DOM representation. Returns a document fragment containing nodes parsed from the provided data.
Parameters
data : string
Returns
DocumentFragment
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.