From 649e813ee8198a9025a4c1a9398dbb82e3d8f46f Mon Sep 17 00:00:00 2001 From: ubermanu Date: Thu, 15 Apr 2021 13:30:22 +0200 Subject: [PATCH] Fixes an endless loop when styling code blocks with a bad format --- src/shared/styling.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/styling.js b/src/shared/styling.js index 175738334..03d58700c 100644 --- a/src/shared/styling.js +++ b/src/shared/styling.js @@ -124,7 +124,7 @@ function getDirectiveLength (d, text, i) { return 0; } else { const substring = text.slice(i+1); - let j; + let j = 0; let idx = substring.indexOf(d); while (idx !== -1) { if (isDirectiveEnd(d, i+1+idx, text)) return idx+1+2*d.length;