Skip to content

Commit

Permalink
...fix previous commit about BeautifulSoup warning about HTML parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly-zdanevich committed May 26, 2024
1 parent 38a34e8 commit bf7bde6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion geeknote/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import sys
import tempfile

from bs4 import BeautifulSoup, NavigableString
import threading
import hashlib
Expand All @@ -16,6 +17,11 @@
from .log import logging
from xml.sax.saxutils import escape, unescape

import warnings
from bs4.builder import XMLParsedAsHTMLWarning

warnings.filterwarnings('ignore', category=XMLParsedAsHTMLWarning)


class EditorThread(threading.Thread):
def __init__(self, editor):
Expand Down Expand Up @@ -84,7 +90,7 @@ def ENMLtoText(
imageOptions={"saveImages": False},
imageFilename="",
):
soup = BeautifulSoup(contentENML, "xml")
soup = BeautifulSoup(contentENML, "html.parser")

if format == "pre":
#
Expand Down

0 comments on commit bf7bde6

Please sign in to comment.