image/image/utils
@ckeditor/ckeditor5-image/src/image/utils
Filtering
Functions
-
protected
createBlockImageViewElement( writer ) → ContainerElement
module:image/image/utils~createBlockImageViewElement
Creates a view element representing the block image.
<figure class="image"><img></img></figure>
Note that
alt
andsrc
attributes are converted separately, so they are not included.Parameters
writer : DowncastWriter
Returns
-
protected
createInlineImageViewElement( writer ) → ContainerElement
module:image/image/utils~createInlineImageViewElement
Creates a view element representing the inline image.
<span class="image-inline"><img></img></span>
Note that
alt
andsrc
attributes are converted separately, so they are not included.Parameters
writer : DowncastWriter
Returns
-
protected
determineImageTypeForInsertionAtSelection( schema, selection ) → 'imageBlock' | 'imageInline'
module:image/image/utils~determineImageTypeForInsertionAtSelection
Considering the current model selection, it returns the name of the model image element (
'imageBlock'
or'imageInline'
) that will make most sense from the UX perspective if a new image was inserted (also: uploaded, dropped, pasted) at that selection.The assumption is that inserting images into empty blocks or on other block widgets should produce block images. Inline images should be inserted in other cases, e.g. in paragraphs that already contain some text.
Parameters
schema : Schema
selection : Selection | DocumentSelection
Returns
'imageBlock' | 'imageInline'
-
protected
getImgViewElementMatcher( editor, matchImageType ) → MatcherPattern
module:image/image/utils~getImgViewElementMatcher
A function returning a
MatcherPattern
for a particular type of View images.Parameters
editor : Editor
matchImageType : 'imageBlock' | 'imageInline'
The type of created image.
Returns
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.