CKEditor 4 Documentation

CKEDITOR.plugins.pastefromword.heuristics

Defined By

Methods

CKEDITOR.plugins.pastefromword.heuristics
view source
( editor, item ) : Object/nullprivate
Assigns list levels to the item and all directly subsequent nodes for which isEdgeListItem returns true. ...

Assigns list levels to the item and all directly subsequent nodes for which isEdgeListItem returns true.

The algorithm determines list item level based on the lowest common non-zero difference in indentation of two or more subsequent list-like elements.

Parameters

Returns

  • Object/null

    null if list levels were already applied, or an object used to verify results in tests.

    • indents : Number[]
    • levels : Number[]
    • diffs : Number[]
CKEDITOR.plugins.pastefromword.heuristics
view source
( indentations ) : Number/nullprivate
Given an array of list indentations, this method tries to guess what the indentation difference per list level is. ...

Given an array of list indentations, this method tries to guess what the indentation difference per list level is. E.g. assuming that you have something like:

* foo (indentation 30px)
        * bar (indentation 90px)
        * baz (indentation 90px)
            * baz (indentation 115px)
    * baz (indentation 60px)

The method will return 30.

Parameters

  • indentations : Number[]

    An array of indentation sizes.

Returns

  • Number/null

    A number or null if empty indentations was given.

CKEDITOR.plugins.pastefromword.heuristics
view source
( item, item ) : Booleanprivate
Decides if an item looks like a list item in Microsoft Edge. ...

Decides if an item looks like a list item in Microsoft Edge.

Note: It will return false when run in a browser other than Microsoft Edge, despite the configuration.

Parameters

Returns

  • Boolean