Report an issue
Class

CKEDITOR.plugins.pastefromword.styles.inliner

class

Filtering

Properties

  • filtered : String[]

    private

    Styles skipped by the styles inliner.

    Defaults to ['break-before', 'break-after', 'break-inside', 'page-break', 'page-break-before', 'page-break-after', 'page-break-inside']

Methods

  • filter( stylesObj ) → Object

    since 4.7.0 private

    Filters out all unnecessary styles.

    Parameters

    stylesObj : Object

    An object containing parsed CSS declarations as property/value pairs (see parse).

    Returns

    Object

    The stylesObj copy with specific styles filtered out.

  • inline( html ) → document

    since 4.7.0 private

    Finds and inlines all the style elements in a given html string and returns a document where all the styles are inlined into appropriate elements.

    This is needed because sometimes Microsoft Word does not put the style directly into the element, but into a generic style sheet.

    Parameters

    html : String

    An HTML string to be parsed.

    Returns

    document
  • parse( styles ) → Array

    since 4.7.0 private

    Parses the content of the provided style element.

    Parameters

    styles : element | String

    The style element or CSS text.

    Returns

    Array

    An array containing parsed styles. Each item (style) is an object containing two properties: selector – A string representing a CSS selector. styles – An object containing a list of styles (e.g. { margin: 0, text-align: 'left' }).

  • sort( stylesArray ) → Array

    since 4.7.0 private

    Sorts the given styles array. All rules containing class selectors will have lower indexes than the rest of the rules. Selectors with the same priority will be sorted in a reverse order than in the input array.

    Parameters

    stylesArray : Array

    An array of styles as returned from parse.

    Returns

    Array

    Sorted stylesArray.