engine/model/utils/autoparagraphing
module
Functions
autoParagraphEmptyRoots( writer ) → booleaninternalmodule:engine/model/utils/autoparagraphing~autoParagraphEmptyRootsFixes all empty roots.
Parameters
writer : ModelWriterThe model writer.
Returns
booleantrueif any change has been applied,falseotherwise.
isParagraphable( position, nodeOrType, schema ) → booleaninternalmodule:engine/model/utils/autoparagraphing~isParagraphableChecks if the given node wrapped with a paragraph would be accepted by the schema in the given position.
Parameters
position : ModelPositionThe position at which to check.
nodeOrType : string | ModelNodeThe child node or child type to check.
schema : ModelSchemaA schema instance used for element validation.
Returns
boolean
wrapInParagraph( position, writer ) → ModelPositioninternalmodule:engine/model/utils/autoparagraphing~wrapInParagraphInserts a new paragraph at the given position and returns a position inside that paragraph.
Parameters
position : ModelPositionThe position where a paragraph should be inserted.
writer : ModelWriterThe model writer.
Returns
ModelPositionPosition inside the created paragraph.