Commits

Benjamin Dumke-von der Ehe  committed a16d0e9

more trimming when building tab/sort shortcuts

  • Participants
  • Parent commits 5ed54e5

Comments (0)

Files changed (2)

File sekeys.updating.user.js

         function getOrderShortcuts(selector) {
             var result = new Shortcuts();
             $(selector + " > a").each(function (i, elem) {
-                var text = $(elem).text().replace(/^\s*[\d*]+/, ""),
+                var text = $(elem).text().replace(/^\s*[\d*]*|\s*$/g, ""),
                     s = sortOrderShortcuts[text]; // TODO: This check needs to be made earlier, before looping. Otherwise, you may get double entries.
                     
                 if (!s) {

File sekeys.user.js

         function getOrderShortcuts(selector) {
             var result = new Shortcuts();
             $(selector + " > a").each(function (i, elem) {
-                var text = $(elem).text().replace(/^\s*[\d*]+/, ""),
+                var text = $(elem).text().replace(/^\s*[\d*]*|\s*$/g, ""),
                     s = sortOrderShortcuts[text]; // TODO: This check needs to be made earlier, before looping. Otherwise, you may get double entries.
                     
                 if (!s) {