diff --git a/aqt/editor.py b/aqt/editor.py index d564b2ad5..8a9be8864 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -254,6 +254,7 @@ class Editor: return txt = urllib.parse.unquote(txt) txt = unicodedata.normalize("NFC", txt) + txt = self.mungeHTML(txt) # misbehaving apps may include a null byte in the text txt = txt.replace("\x00", "") # reverse the url quoting we added to get images to display @@ -285,6 +286,10 @@ class Editor: else: print("uncaught cmd", cmd) + def mungeHTML(self, txt): + txt = re.sub(r"
$", "", txt) + return txt + # Setting/unsetting the current note ######################################################################