image/image/utils
@ckeditor/ckeditor5-image/src/image/utils
Filtering
Functions
-
createBlockImageViewElement( writer ) → ContainerElement
module:image/image/utils~createBlockImageViewElement
protected
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
-
createInlineImageViewElement( writer ) → ContainerElement
module:image/image/utils~createInlineImageViewElement
protected
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
-
determineImageTypeForInsertionAtSelection( schema, selection ) → 'imageBlock' | 'imageInline'
module:image/image/utils~determineImageTypeForInsertionAtSelection
protected
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'
-
getImgViewElementMatcher( editor, matchImageType ) → MatcherPattern
module:image/image/utils~getImgViewElementMatcher
protected
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 an outdated information? Is something missing? Please report it via our issue tracker.