summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorJean Abou Samra <jean@abou-samra.fr>2023-03-01 00:58:35 +0100
committerJean Abou Samra <jean@abou-samra.fr>2023-03-01 01:01:47 +0100
commit97eb3d5ec7c1b3ea4fcf9dee30a2309cf92bd194 (patch)
treeb471f9d25c36f8f5c600b4d46caef65077828779 /pygments
parent5f8c54198ed6bf84c3e116fa72426aaf8b4e8f57 (diff)
downloadpygments-git-97eb3d5ec7c1b3ea4fcf9dee30a2309cf92bd194.tar.gz
SQL+Jinja: use a simpler regex in analyse_text
Fixes catastrophic backtracking Fixes #2355
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/templates.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/pygments/lexers/templates.py b/pygments/lexers/templates.py
index 1fcf7085..10662943 100644
--- a/pygments/lexers/templates.py
+++ b/pygments/lexers/templates.py
@@ -2291,10 +2291,6 @@ class SqlJinjaLexer(DelegatingLexer):
if re.search(r'\{\{\s*source\(.*\)\s*\}\}', text):
rv += 0.25
# Jinja macro
- if re.search(
- r'\{%-?\s*macro \w+\(.*\)\s*-?%\}\s+.*\s+\{%-?\s*endmacro\s*-?%\}',
- text,
- re.S,
- ):
+ if re.search(r'\{%-?\s*macro \w+\(.*\)\s*-?%\}', text):
rv += 0.15
return rv