Preserve script tags in JS minify (#22678)

This commit is contained in:
Glenn Jocher 2025-11-13 12:30:28 +01:00 committed by GitHub
parent 7c21598407
commit b123b9e213
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -263,7 +263,7 @@ def remove_macros():
# Precompiled regex patterns for minification
HTML_COMMENT = re.compile(r"<!--[\s\S]*?-->")
HTML_PRESERVE = re.compile(r"<(pre|code|textarea)[^>]*>[\s\S]*?</\1>", re.IGNORECASE)
HTML_PRESERVE = re.compile(r"<(pre|code|textarea|script)[^>]*>[\s\S]*?</\1>", re.IGNORECASE)
HTML_TAG_SPACE = re.compile(r">\s+<")
HTML_MULTI_SPACE = re.compile(r"\s{2,}")
HTML_EMPTY_LINE = re.compile(r"^\s*$\n", re.MULTILINE)