X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fpastefromword%2Ffilter%2Fdefault.js;h=13ff5bcfe5d850470d33611ac793896911677ce3;hp=e29d1c5e22dc38d3ef8b8fa4e268a83f41ff8759;hb=614511639979907ceb0da3614122a4d8eb963ad4;hpb=039a051ccf3901311661022a30afd60fc38130c9 diff --git a/_source/plugins/pastefromword/filter/default.js b/_source/plugins/pastefromword/filter/default.js index e29d1c5..13ff5bc 100644 --- a/_source/plugins/pastefromword/filter/default.js +++ b/_source/plugins/pastefromword/filter/default.js @@ -120,6 +120,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var cssLengthRelativeUnit = /^([.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz){1}?/i; var emptyMarginRegex = /^(?:\b0[^\s]*\s*){1,4}$/; // e.g. 0px 0pt 0px + var romanLiternalPattern = '^m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})$', + lowerRomanLiteralRegex = new RegExp( romanLiternalPattern ), + upperRomanLiteralRegex = new RegExp( romanLiternalPattern.toUpperCase() ); var listBaseIndent = 0, previousListItemMargin; @@ -144,8 +147,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { if ( !isNaN( bulletStyle[ 1 ] ) ) bulletStyle = 'decimal'; - // No way to distinguish between Roman numerals and Alphas, - // detect them as a whole. + else if ( lowerRomanLiteralRegex.test( bulletStyle[ 1 ] ) ) + bulletStyle = 'lower-roman'; + else if ( upperRomanLiteralRegex.test( bulletStyle[ 1 ] ) ) + bulletStyle = 'upper-roman'; else if ( /^[a-z]+$/.test( bulletStyle[ 1 ] ) ) bulletStyle = 'lower-alpha'; else if ( /^[A-Z]+$/.test( bulletStyle[ 1 ] ) )