Skip to content

Commit 103be84

Browse files
committed
attempt 3
1 parent a7500e4 commit 103be84

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/reactpy/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ def string_to_reactpy(
118118
recover=not strict,
119119
),
120120
)
121-
return _etree_to_vdom(root_node, transforms, intercept_links)
122121
except etree.XMLSyntaxError as e:
123122
if strict:
124123
msg = (
@@ -129,6 +128,8 @@ def string_to_reactpy(
129128
"Otherwise, repair your broken HTML and try again."
130129
)
131130
raise HTMLParseError(msg) from e
131+
else:
132+
return _etree_to_vdom(root_node, transforms, intercept_links)
132133

133134

134135
class HTMLParseError(etree.LxmlSyntaxError): # type: ignore[misc]

tests/test_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,10 @@ def make_links_blue(node):
260260

261261

262262
def test_non_html_tag_behavior():
263-
source = "<mytag data-x=something><my-other-tag key=a-key /></mytag>"
263+
source = "<ABC data-x=something><my-other-tag key=a-key /></ABC>"
264264

265265
expected = {
266-
"tagName": "mytag",
266+
"tagName": "abc",
267267
"attributes": {"data-x": "something"},
268268
"children": [
269269
{"tagName": "my-other-tag", "attributes": {"key": "a-key"}, "key": "a-key"},

0 commit comments

Comments
 (0)