Skip to content

Commit

Permalink
Merge pull request #68 from cheywood/fix-html-formatter-producing-xml
Browse files Browse the repository at this point in the history
Fix HTML formatter producing invalid markup (from valid markup)
  • Loading branch information
aleiepure authored Feb 8, 2025
2 parents d7a9800 + 84e0c01 commit ddedd5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/formatters/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def _format(self, text:str, indents:int):

doc_root = html.fromstring(text)
etree.indent(doc_root, space=indent_str)
return etree.tostring(doc_root, encoding='unicode', pretty_print=True)
return etree.tostring(doc_root, method='html', encoding='unicode', pretty_print=True)

def is_correct(self, text:str) -> bool:
if isinstance(text, str):
Expand Down

0 comments on commit ddedd5a

Please sign in to comment.