From b8a88fe89c0f7b4850a111d86a3a39d7e47d48a6 Mon Sep 17 00:00:00 2001 From: Bavisetti Narayan <72156168+NarayanBavisetti@users.noreply.github.com> Date: Wed, 20 Aug 2025 21:26:21 +0530 Subject: [PATCH] [WIKI-599] chore: removed the regex tags calculation in description (#7608) --- apps/api/plane/utils/content_validator.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/apps/api/plane/utils/content_validator.py b/apps/api/plane/utils/content_validator.py index 7b9932a35..d28b83fc7 100644 --- a/apps/api/plane/utils/content_validator.py +++ b/apps/api/plane/utils/content_validator.py @@ -187,24 +187,6 @@ def validate_html_content(html_content): f"HTML content contains dangerous JavaScript in event handler: {handler_content[:100]}", ) - # Basic HTML structure validation - check for common malformed tags - try: - # Count opening and closing tags for basic structure validation - opening_tags = re.findall(r"<(\w+)[^>]*>", html_content) - closing_tags = re.findall(r"", html_content) - - # Filter out self-closing tags from opening tags - opening_tags_filtered = [ - tag for tag in opening_tags if tag.lower() not in SELF_CLOSING_TAGS - ] - - # Basic check - if we have significantly more opening than closing tags, it might be malformed - if len(opening_tags_filtered) > len(closing_tags) + 10: # Allow some tolerance - return False, "HTML content appears to be malformed (unmatched tags)" - - except Exception: - # If HTML parsing fails, we'll allow it - pass return True, None