Module

image/image/utils

@ckeditor/ckeditor5-image/src/image/utils

module

Filtering

Functions

  • createBlockImageViewElement( writer ) → ContainerElement

    protected

    Creates a view element representing the block image.

    <figure class="image"><img></img></figure>
    

    Note that alt and src attributes are converted separately, so they are not included.

    Parameters

    writer : DowncastWriter

    Returns

    ContainerElement
  • createInlineImageViewElement( writer ) → ContainerElement

    protected

    Creates a view element representing the inline image.

    <span class="image-inline"><img></img></span>
    

    Note that alt and src attributes are converted separately, so they are not included.

    Parameters

    writer : DowncastWriter

    Returns

    ContainerElement
  • determineImageTypeForInsertionAtSelection( schema, selection ) → 'imageBlock' | 'imageInline'

    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

    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

    MatcherPattern