Przeglądaj źródła

fixed macro replacement

tags/1.0.5
Robin Thoni 10 lat temu
rodzic
commit
2c42657b82
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1
    1
      app/controllers/home.controller.js

+ 1
- 1
app/controllers/home.controller.js Wyświetl plik

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;

Ładowanie…
Anuluj
Zapisz