CKEDITOR.plugins.pastetools.filters.common.styles.inliner
Filtering
Properties
since 4.13.0 private
filtered : String[]CKEDITOR.plugins.pastetools.filters.common.styles.inliner#filteredStyles 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
since 4.13.0 private
filter( stylesObj ) → ObjectCKEDITOR.plugins.pastetools.filters.common.styles.inliner#filterFilters out all unnecessary styles.
Parameters
stylesObj : ObjectAn object containing parsed CSS declarations as property/value pairs (see parse).
Returns
ObjectThe
stylesObjcopy with specific styles filtered out.since 4.13.0 private
inline( html ) → documentCKEDITOR.plugins.pastetools.filters.common.styles.inliner#inlineFinds and inlines all the
<style>elements in a givenhtmlstring 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 : StringAn HTML string to be parsed.
Returns
document
since 4.13.0 private
parse( styles ) → ArrayCKEDITOR.plugins.pastetools.filters.common.styles.inliner#parseParses the content of the provided
<style>element.Parameters
styles : element | StringThe
<style>element or CSS text.Returns
ArrayAn 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' }).since 4.13.0 private
sort( stylesArray ) → ArrayCKEDITOR.plugins.pastetools.filters.common.styles.inliner#sortSorts 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 : ArrayAn array of styles as returned from parse.
Returns
ArraySorted
stylesArray.