Module

paste-from-office/filters/space

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

module

Filtering

Functions

  • normalizeSpacerunSpans( htmlDocument ) → void

    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 _processDomInlineNodes).

    Parameters

    htmlDocument : Document

    Native Document object in which spacing should be normalized.

    Returns

    void
  • normalizeSpacing( htmlString ) → string

    Replaces last space preceding elements closing tag with &nbsp;. Such operation prevents spaces from being removed during further DOM/View processing (see especially _processDomInlineNodes). 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.