File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -118,19 +118,17 @@ def string_to_reactpy(
118118 recover = not strict ,
119119 ),
120120 )
121+ return _etree_to_vdom (root_node , transforms , intercept_links )
121122 except etree .XMLSyntaxError as e :
122- if not strict :
123- raise e # nocov
124- msg = (
125- "An error has occurred while parsing the HTML.\n \n "
126- "This HTML may be malformatted, or may not perfectly adhere to HTML5.\n "
127- "If you believe the exception above was due to something intentional, you "
128- "can disable the strict parameter on string_to_reactpy().\n "
129- "Otherwise, repair your broken HTML and try again."
130- )
131- raise HTMLParseError (msg ) from e
132-
133- return _etree_to_vdom (root_node , transforms , intercept_links )
123+ if strict :
124+ msg = (
125+ "An error has occurred while parsing the HTML.\n \n "
126+ "This HTML may be malformatted, or may not perfectly adhere to HTML5.\n "
127+ "If you believe the exception above was due to something intentional, you "
128+ "can disable the strict parameter on string_to_reactpy().\n "
129+ "Otherwise, repair your broken HTML and try again."
130+ )
131+ raise HTMLParseError (msg ) from e
134132
135133
136134class HTMLParseError (etree .LxmlSyntaxError ): # type: ignore[misc]
You can’t perform that action at this time.
0 commit comments