enhancement/implement_tooltips_for_xpath3 #242
@@ -8,7 +8,7 @@ def convertHTML(source: str, sourceFrom: str):
|
|||||||
|
|
||||||
if sourceFrom == "xml":
|
if sourceFrom == "xml":
|
||||||
xmldoc = etree.parse(BytesIO(source.encode("utf-8")), xmlParser)
|
xmldoc = etree.parse(BytesIO(source.encode("utf-8")), xmlParser)
|
||||||
return html.tostring(xmldoc, method="html", pretty_print=True).decode()
|
return html.tostring(xmldoc, method="html", pretty_print=True, doctype="<!DOCTYPE html>").decode()
|
||||||
elif sourceFrom == "html":
|
elif sourceFrom == "html":
|
||||||
htmldoc = html.parse(BytesIO(source.encode("utf-8")), htmlParser)
|
htmldoc = html.parse(BytesIO(source.encode("utf-8")), htmlParser)
|
||||||
return etree.tostring(htmldoc, method="xml", pretty_print=True, doctype="", xml_declaration=True, encoding="utf-8").decode()
|
return etree.tostring(htmldoc, method="xml", pretty_print=True, doctype="", xml_declaration=True, encoding="utf-8").decode()
|
||||||
|
|||||||
Reference in New Issue
Block a user