code-block/converters
@ckeditor/ckeditor5-code-block/src/converters
Filtering
Functions
-
dataViewToModelCodeBlockInsertion( editingView, languageDefs ) → function
A view-to-model converter for
<pre>
with the<code>
HTML.Sample input:
Sample output:
Parameters
editingView : View
languageDefs : Array.<CodeBlockLanguageDefinition>
The normalized language configuration passed to the feature.
Returns
function
Returns a conversion callback.
-
dataViewToModelOrphanNodeConsumer() → function
A view-to-model converter that handles orphan text nodes (white spaces, new lines, etc.) that surround
<code>
inside<pre>
.Sample input:
Unified output for each case:
Returns
function
Returns a conversion callback.
-
dataViewToModelTextNewlinesInsertion() → function
A view-to-model converter for new line characters in
<pre>
.Sample input:
Sample output:
Returns
function
Returns a conversion callback.
-
modelToDataViewSoftBreakInsertion( model ) → function
A model-to-data view converter for the new line (
softBreak
) separator.Sample input:
Sample output:
Parameters
model : Model
Returns
function
Returns a conversion callback.
-
modelToViewCodeBlockInsertion( model, languageDefs, [ useLabels ] ) → function
A model-to-view (both editing and data) converter for the
codeBlock
element.Sample input:
Sample output (editing):
Sample output (data, see
modelToDataViewSoftBreakInsertion
):Parameters
model : Model
languageDefs : Array.<CodeBlockLanguageDefinition>
The normalized language configuration passed to the feature.
[ useLabels ] : Boolean
When
true
, the<pre>
element will get adata-language
attribute with a human–readable label of the language. Used only in the editing.Defaults to
false
Returns
function
Returns a conversion callback.
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.