Report an issue
Module

paste-from-office/filters/space

@ckeditor/ckeditor5-paste-from-office/src/filters/space

module

Filtering

Functions

  • normalizeSpacerunSpans( htmlDocument )

    static

    Normalizes spacing in special Word spacerun spans (<span style='mso-spacerun:yes'>\s+</span>) by replacing all spaces with &nbsp; pairs. This prevents spaces from being removed during further DOM/View processing (see especially _processDataFromDomText).

    Parameters

    htmlDocument : Document

    Native Document object in which spacing should be normalized.

  • normalizeSpacing( htmlString ) → String

    static

    Replaces last space preceding elements closing tag with &nbsp;. Such operation prevents spaces from being removed during further DOM/View processing (see especially _processDataFromDomText). This method also takes into account Word specific <o:p></o:p> empty tags. Additionally multiline sequences of spaces and new lines between tags are removed (see #39 and #40).

    Parameters

    htmlString : String

    HTML string in which spacing should be normalized.

    Returns

    String

    Input HTML with spaces normalized.