Skip to content

Conversation

@rahuldevikar761
Copy link
Collaborator

image

html = re.sub(r'<code[^>]*>(.*?)</code>', lambda m: f"`{re.sub(r'<[^>]+>', '', m.group(1))}`", html, flags=re.DOTALL | re.IGNORECASE)

# Remove script, style, nav, header, footer tags
html = re.sub(r'<script[^>]*>.*?</script>', '', html, flags=re.DOTALL | re.IGNORECASE)

Check failure

Code scanning / CodeQL

Bad HTML filtering regexp High

This regular expression does not match script end tags like </script >.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants