Report an issue
Class

CKEDITOR.plugins.pastefromword.lists.numbering

class

Filtering

Methods

  • getStyle( marker ) → String

    Returns a list style based on the Word marker content.

    var getStyle = CKEDITOR.plugins.pastefromword.lists.numbering.getStyle;
    
    console.log( getStyle( '4' ) ); // Logs: "decimal"
    console.log( getStyle( 'b' ) ); // Logs: "lower-alpha"
    console.log( getStyle( 'P' ) ); // Logs: "upper-alpha"
    console.log( getStyle( 'i' ) ); // Logs: "lower-roman"
    console.log( getStyle( 'X' ) ); // Logs: "upper-roman"
    

    Implementation note: Characters c and d are not converted to roman on purpose. It is 100 and 500 respectively, so you rarely go with a list up until this point, while it is common to start with c and d in alpha.

    Parameters

    marker : String

    Marker content retained from Word, e.g. 1, 7, XI, b.

    Returns

    String

    Resolved marker type.

  • toNumber( marker, markerType ) → Number

    Converts the list marker value into a decimal number.

     var toNumber = CKEDITOR.plugins.pastefromword.lists.numbering.toNumber;
    
     console.log( toNumber( 'XIV', 'upper-roman' ) ); // Logs 14.
     console.log( toNumber( 'd', 'lower-alpha' ) ); // Logs 4.
     console.log( toNumber( '35', 'decimal' ) ); // Logs 35.
     console.log( toNumber( '404', 'foo' ) ); // Logs 1.
    

    Parameters

    marker : String
    markerType : String

    Marker type according to CSS list-style-type values.

    Returns

    Number