fix bug on HTML tree (#561)
This commit is contained in:
@@ -96,7 +96,7 @@ def json_to_html(element: dict) -> str:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Check if the element is self-closing
|
# Check if the element is self-closing
|
||||||
if tag in ["img", "input", "br", "hr", "meta", "link"]:
|
if tag in ["img", "input", "br", "hr", "meta", "link"] and not option_html and not children_html:
|
||||||
return f'<{tag}{attributes_html if not attributes_html else " "+attributes_html}>'
|
return f'<{tag}{attributes_html if not attributes_html else " "+attributes_html}>'
|
||||||
else:
|
else:
|
||||||
return f'<{tag}{attributes_html if not attributes_html else " "+attributes_html}>{text}{children_html+option_html}</{tag}>'
|
return f'<{tag}{attributes_html if not attributes_html else " "+attributes_html}>{text}{children_html+option_html}</{tag}>'
|
||||||
|
|||||||
Reference in New Issue
Block a user