Pārlūkot izejas kodu

fixed macro replacement

tags/1.0.5
Robin Thoni 9 gadus atpakaļ
vecāks
revīzija
2c42657b82
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1
    1
      app/controllers/home.controller.js

+ 1
- 1
app/controllers/home.controller.js Parādīt failu

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;

Notiek ielāde…
Atcelt
Saglabāt