Skip to content

Commit 3312628

Browse files
bloodywingadamghill
authored andcommitted
Allow custom html tags to be valid
Some icon libraries, namely ionicons which adds a custom html tag e.g.: ion-icon
1 parent f478ec2 commit 3312628

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

django_unicorn/components/unicorn_template_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def is_html_well_formed(html: str) -> bool:
5050

5151
for tag in tag_list:
5252
if "/" not in tag:
53-
cleaned_tag = re.sub(r"(<(\w+)[^>!]*>)", r"<\2>", tag)
53+
cleaned_tag = re.sub(r"(<([\w\-]+)[^>!]*>)", r"<\2>", tag)
5454

5555
if cleaned_tag not in EMPTY_ELEMENTS:
5656
stack.append(cleaned_tag)

0 commit comments

Comments
 (0)