Pārlūkot izejas kodu

Fixes an endless loop when styling code blocks with a bad format

ubermanu 4 gadi atpakaļ
vecāks
revīzija
649e813ee8
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      src/shared/styling.js

+ 1 - 1
src/shared/styling.js

@@ -124,7 +124,7 @@ function getDirectiveLength (d, text, i) {
         return 0;
         return 0;
     } else {
     } else {
         const substring = text.slice(i+1);
         const substring = text.slice(i+1);
-        let j;
+        let j = 0;
         let idx = substring.indexOf(d);
         let idx = substring.indexOf(d);
         while (idx !== -1) {
         while (idx !== -1) {
             if (isDirectiveEnd(d, i+1+idx, text)) return idx+1+2*d.length;
             if (isDirectiveEnd(d, i+1+idx, text)) return idx+1+2*d.length;