- in regex character classes has special meaning
authorAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 27 Dec 2009 15:44:24 +0000 (15:44 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 27 Dec 2009 15:44:24 +0000 (15:44 +0000)
Fix for r60376, pointed out by Thana on bug 21946.

skins/common/wikibits.js

index 95b2e06..11361df 100644 (file)
@@ -705,9 +705,9 @@ function ts_initTransformTable() {
        // if percents and regular numbers aren't being mixed.
        ts_number_regex = new RegExp(
                "^(" +
-                       "[+-\u2212]?[0-9][0-9,]*(\\.[0-9,]*)?(E[+-\u2212]?[0-9][0-9,]*)?" + // Fortran-style scientific
+                       "[-+\u2212]?[0-9][0-9,]*(\\.[0-9,]*)?(E[-+\u2212]?[0-9][0-9,]*)?" + // Fortran-style scientific
                        "|" +
-                       "[+-\u2212]?" + digitClass + "+%?" + // Generic localised
+                       "[-+\u2212]?" + digitClass + "+%?" + // Generic localised
                ")$", "i"
        );
 }