Skip to content

Commit

Permalink
BeatifulSoup constructor: get rid of XMLParsedAsHTMLWarning
Browse files Browse the repository at this point in the history
To solve this warning on geeknote show xx:

Tags: game
/usr/lib/python3.11/html/parser.py:170: XMLParsedAsHTMLWarning: It looks like you are parsing an XML document using an HTML parser. If this really is an HTML document (maybe it ss XHTML?), you can ignore or filter this warning. If it is XML, you should know that using an XML parser will be more reliable. To parse this document as XML, make sure you have the lxml package installed, and pass the keyword argument `features="xml"` into the BeautifulSoup constructor.
  • Loading branch information
vitaly-zdanevich committed May 26, 2024
1 parent d3fae58 commit 38a34e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion geeknote/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def ENMLtoText(
imageOptions={"saveImages": False},
imageFilename="",
):
soup = BeautifulSoup(contentENML, "html.parser")
soup = BeautifulSoup(contentENML, "xml")

if format == "pre":
#
Expand Down

0 comments on commit 38a34e8

Please sign in to comment.