ソースを参照

[bugfix] rm debug + token start

B Thibault 8 年 前
コミット
ab8a37b733
1 ファイル変更2 行追加7 行削除
  1. 2 7
      msgFormatter.js

+ 2 - 7
msgFormatter.js

@@ -251,8 +251,8 @@ var formatText = (function() {
             if ('\n' === text[i])
                 return text[i];
             if (['*', '~', '-', '_' ].indexOf(text[i]) !== -1 &&
-                (nextIsAlphadec || ['*', '~', '-', '_', '<', '&'].indexOf(text[i+1]) !== -1) &&
-                (prevIsAlphadec || ['*', '~', '-', '_', '<', '&'].indexOf(text[i-1]) !== -1))
+                (nextIsAlphadec || text[i +1] === undefined || ['*', '~', '-', '_', '<', '&'].indexOf(text[i+1]) !== -1) &&
+                (!prevIsAlphadec || text[i -1] === undefined || ['*', '~', '-', '_', '<', '&'].indexOf(text[i-1]) !== -1))
                 return text[i];
             if ([':'].indexOf(text[i]) !== -1 && nextIsAlphadec)
                 return text[i];
@@ -592,10 +592,5 @@ var formatText = (function() {
     return _parse;
 })();
 
-window['_formatText'] = function(str, opts) {
-    return formatText(str, {
-        highlights: opts ? opts["highlights"] : undefined
-    });
-};
 if (typeof module !== "undefined") module.exports.formatText = formatText;