More descriptive

main
Bob Mottram 2022-07-17 18:46:09 +01:00
parent 3d5b658490
commit b14a7c9f0b
1 changed files with 2 additions and 2 deletions

View File

@ -1070,7 +1070,7 @@ def _is_dangerous_string_simple(content: str, allow_local_network_access: bool,
return False
def _valid_html_tag(tag_name: str, content: str) -> bool:
def _html_tag_has_closing(tag_name: str, content: str) -> bool:
"""Does the given tag have opening and closing labels?
"""
content_lower = content.lower()
@ -1106,7 +1106,7 @@ def dangerous_markup(content: str, allow_local_network_access: bool) -> bool:
if _is_dangerous_string_simple(content, allow_local_network_access,
separators, invalid_strings):
return True
if not _valid_html_tag('code', content):
if not _html_tag_has_closing('code', content):
return True
invalid_strings = [
'script', 'noscript', 'pre',