Potential fix for code scanning alert no. 47: Bad HTML filtering regexp

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
Xin Jin
2025-07-09 11:30:26 -07:00
committed by GitHub
co-authored by Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
parent 841c50ba73
commit 3641a342be
+2 -2
View File
@@ -45,8 +45,8 @@ def _clean_markdown(content: str) -> str:
# Remove frontmatter
content = re.sub(r'^---\n.*?\n---\n', '', content, flags=re.DOTALL)
# Remove script tags (handle spaces in closing tags)
content = re.sub(r'<script[^>]*>.*?</script\s*>', '', content, flags=re.DOTALL | re.IGNORECASE)
# Remove script tags (handle malformed closing tags)
content = re.sub(r'<script[^>]*>.*?</script[^>]*>', '', content, flags=re.DOTALL | re.IGNORECASE)
# Remove style tags (handle spaces in closing tags)
content = re.sub(r'<style[^>]*>.*?</style\s*>', '', content, flags=re.DOTALL | re.IGNORECASE)