From d496052534bb4317373991098d15ddd5ccb8f566 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 2 Dec 2020 14:40:23 -0500 Subject: [PATCH] fix(latex) fix poly backtracking issue --- src/languages/latex.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/latex.js b/src/languages/latex.js index 0cadd1a09e..47b0636de8 100644 --- a/src/languages/latex.js +++ b/src/languages/latex.js @@ -172,7 +172,7 @@ export default function(hljs) { const BEGIN_ENV = function(envname, starts_mode) { return hljs.inherit( { - begin: '\\\\begin(?=\\s*\\r?\\n?\\s*\\{' + envname + '\\})', + begin: '\\\\begin(?=[ \t]*(\\r?\\n[ \t]*)?\\{' + envname + '\\})', keywords: {$pattern: /\\[a-zA-Z]+/, keyword: '\\begin'}, relevance: 0, },