X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fpastefromword%2Ffilter%2Fdefault.js;h=6b2a632c29a98590a528bd9b4a976f0c6eeb0ab5;hb=48b1db88210b4160dce439c6e3e32e14af8c106b;hp=e29d1c5e22dc38d3ef8b8fa4e268a83f41ff8759;hpb=039a051ccf3901311661022a30afd60fc38130c9;p=ckeditor.git diff --git a/_source/plugins/pastefromword/filter/default.js b/_source/plugins/pastefromword/filter/default.js index e29d1c5..6b2a632 100644 --- a/_source/plugins/pastefromword/filter/default.js +++ b/_source/plugins/pastefromword/filter/default.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -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 ] ) )