revert Commmented redundat endpoints
This commit is contained in:
2025-01-17 10:45:10 +01:00
parent 097af3ed3a
commit 9cb949b485
2 changed files with 10 additions and 8 deletions

View File

@@ -23,7 +23,7 @@ def formatHTML(source: str, prettify: bool) -> str:
return html.tostring(htmlDoc).decode().replace("\n", "").replace("> ", ">")
return etree.tostring(htmlDoc, encoding='unicode', pretty_print=True)
def formatXML(source: str) -> str:
def formatXML(source: str, prettify: bool) -> str:
"""Method used to format XML
:param source: XML to format
@@ -46,7 +46,10 @@ def formatXML(source: str) -> str:
parser = etree.XMLParser(remove_blank_text=True)
xml = etree.parse(byte_input, parser=parser)
return prolog + etree.tostring(xml, pretty_print=False).decode()
if prettify:
prolog += "\n"
return prolog + etree.tostring(xml, pretty_print=prettify).decode()
def xpath(source: str, xpath: str) -> str: