瀏覽代碼

fixed macro replacement

tags/1.0.5
Robin Thoni 9 年之前
父節點
當前提交
2c42657b82
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      app/controllers/home.controller.js

+ 1
- 1
app/controllers/home.controller.js 查看文件

37
                     .trim();
37
                     .trim();
38
                 $scope.macros.forEach(function(macro)
38
                 $scope.macros.forEach(function(macro)
39
                 {
39
                 {
40
-                    var regex = macro.latex.match(/[a-zA-Z0-9]$/) != null ? "([^a-zA-Z0-9])" : "";
40
+                    var regex = macro.latex.match(/[a-zA-Z0-9]$/) != null ? "([^a-zA-Z0-9])" : "()";
41
                     text = text.replace(new RegExp($scope.escapeRegExp(macro.latex) + regex, "g"), function($1, $2)
41
                     text = text.replace(new RegExp($scope.escapeRegExp(macro.latex) + regex, "g"), function($1, $2)
42
                     {
42
                     {
43
                         return macro.html + $2;
43
                         return macro.html + $2;

Loading…
取消
儲存