Module

html-support/utils

@ckeditor/ckeditor5-html-support/src/utils

module

Filtering

Interfaces

Functions

  • getHtmlAttributeName( viewElementName ) → string

    Returns the attribute name of the model element that holds raw HTML attributes.

    Parameters

    viewElementName : string

    Returns

    string
  • mergeViewElementAttributes( target, source ) → GHSViewAttributes

    Merges view element attribute objects.

    Parameters

    target : GHSViewAttributes
    source : GHSViewAttributes

    Returns

    GHSViewAttributes
  • modifyGhsAttribute( writer, item, ghsAttributeName, subject, callback ) → void

    Updates a GHS attribute on a specified item.

    Parameters

    writer : Writer
    item : DocumentSelection | Item
    ghsAttributeName : string
    subject : 'attributes'
    callback : ModifyGhsAttributesCallback

    That receives a map as an argument and should modify it (add or remove entries).

    Returns

    void
  • modifyGhsAttribute( writer, item, ghsAttributeName, subject, callback ) → void

    Updates a GHS attribute on a specified item.

    Parameters

    writer : Writer
    item : DocumentSelection | Item
    ghsAttributeName : string
    subject : 'styles'
    callback : ModifyGhsStylesCallback

    That receives a map as an argument and should modify it (add or remove entries).

    Returns

    void
  • modifyGhsAttribute( writer, item, ghsAttributeName, subject, callback ) → void

    Updates a GHS attribute on a specified item.

    Parameters

    writer : Writer
    item : DocumentSelection | Item
    ghsAttributeName : string
    subject : 'classes'
    callback : ModifyGhsClassesCallback

    That receives a set as an argument and should modify it (add or remove entries).

    Returns

    void
  • removeViewAttributes( writer, viewAttributes, viewElement ) → void

    Helper function for the downcast converter. Removes attributes on the given view element.

    Parameters

    writer : DowncastWriter

    The view writer.

    viewAttributes : GHSViewAttributes

    The GHS attribute value.

    viewElement : Element

    The view element to update.

    Returns

    void
  • setViewAttributes( writer, viewAttributes, viewElement ) → void

    Helper function for the downcast converter. Sets attributes on the given view element.

    Parameters

    writer : DowncastWriter

    The view writer.

    viewAttributes : GHSViewAttributes

    The GHS attribute value.

    viewElement : Element

    The view element to update.

    Returns

    void
  • toPascalCase( data ) → string

    Transforms passed string to PascalCase format. Examples:

    • div => Div
    • h1 => H1
    • table => Table

    Parameters

    data : string

    Returns

    string
  • updateViewAttributes( writer, oldViewAttributes, newViewAttributes, viewElement ) → void

    Helper function for the downcast converter. Updates attributes on the given view element.

    Parameters

    writer : DowncastWriter

    The view writer.

    oldViewAttributes : GHSViewAttributes

    The previous GHS attribute value.

    newViewAttributes : GHSViewAttributes

    The current GHS attribute value.

    viewElement : Element

    The view element to update.

    Returns

    void