JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4.3
[ckeditor.git] / _source / plugins / pastefromword / filter / default.js
index e29d1c5..13ff5bc 100644 (file)
@@ -120,6 +120,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
        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;\r
        var emptyMarginRegex = /^(?:\b0[^\s]*\s*){1,4}$/;               // e.g. 0px 0pt 0px\r
+       var romanLiternalPattern = '^m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})$',\r
+               lowerRomanLiteralRegex = new RegExp( romanLiternalPattern ),\r
+               upperRomanLiteralRegex = new RegExp( romanLiternalPattern.toUpperCase() );\r
 \r
        var listBaseIndent = 0,\r
                 previousListItemMargin;\r
@@ -144,8 +147,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                {\r
                                        if ( !isNaN( bulletStyle[ 1 ] ) )\r
                                                bulletStyle = 'decimal';\r
-                                       // No way to distinguish between Roman numerals and Alphas,\r
-                                       // detect them as a whole.\r
+                                       else if ( lowerRomanLiteralRegex.test( bulletStyle[ 1 ] ) )\r
+                                               bulletStyle = 'lower-roman';\r
+                                       else if ( upperRomanLiteralRegex.test( bulletStyle[ 1 ] ) )\r
+                                               bulletStyle = 'upper-roman';\r
                                        else if ( /^[a-z]+$/.test( bulletStyle[ 1 ] ) )\r
                                                bulletStyle = 'lower-alpha';\r
                                        else if ( /^[A-Z]+$/.test( bulletStyle[ 1 ] ) )\r