Browse Source

fixed macro replacement

tags/1.0.5
Robin Thoni 8 years ago
parent
commit
2c42657b82
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      app/controllers/home.controller.js

+ 1
- 1
app/controllers/home.controller.js View File

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…
Cancel
Save