X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fpastefromword%2Ffilter%2Fdefault.js;h=13ff5bcfe5d850470d33611ac793896911677ce3;hb=614511639979907ceb0da3614122a4d8eb963ad4;hp=61ceaf8e2906488c2e4647e39f6fb7b6c99829ea;hpb=055b6b0792ce7dc53d47af606b367c04b927c2ab;p=ckeditor.git diff --git a/_source/plugins/pastefromword/filter/default.js b/_source/plugins/pastefromword/filter/default.js index 61ceaf8..13ff5bc 100644 --- a/_source/plugins/pastefromword/filter/default.js +++ b/_source/plugins/pastefromword/filter/default.js @@ -118,8 +118,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return result; }; - var cssLengthRelativeUnit = /^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz){1}?/i; + 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 ] ) ) @@ -219,7 +224,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { // Be able to deal with component/short-hand form style. var values = margin.split( ' ' ); - margin = values[ 3 ] || values[ 1 ] || values [ 0 ]; + margin = CKEDITOR.plugins.pastefromword.utils.convertToPx( values[ 3 ] || values[ 1 ] || values [ 0 ] ); margin = parseInt( margin, 10 ); // Figure out the indent unit by looking at the first increament.