File tree Expand file tree Collapse file tree 1 file changed +0
-18
lines changed
Expand file tree Collapse file tree 1 file changed +0
-18
lines changed Original file line number Diff line number Diff line change @@ -187,24 +187,6 @@ def validate_html_content(html_content):
187187 f"HTML content contains dangerous JavaScript in event handler: { handler_content [:100 ]} " ,
188188 )
189189
190- # Basic HTML structure validation - check for common malformed tags
191- try :
192- # Count opening and closing tags for basic structure validation
193- opening_tags = re .findall (r"<(\w+)[^>]*>" , html_content )
194- closing_tags = re .findall (r"</(\w+)>" , html_content )
195-
196- # Filter out self-closing tags from opening tags
197- opening_tags_filtered = [
198- tag for tag in opening_tags if tag .lower () not in SELF_CLOSING_TAGS
199- ]
200-
201- # Basic check - if we have significantly more opening than closing tags, it might be malformed
202- if len (opening_tags_filtered ) > len (closing_tags ) + 10 : # Allow some tolerance
203- return False , "HTML content appears to be malformed (unmatched tags)"
204-
205- except Exception :
206- # If HTML parsing fails, we'll allow it
207- pass
208190
209191 return True , None
210192
You can’t perform that action at this time.
0 commit comments