diff --git a/aqt/editor.py b/aqt/editor.py index 1589afc3f..87012eab0 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -256,6 +256,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 @@ -287,6 +288,10 @@ class Editor: else: print("uncaught cmd", cmd) + def mungeHTML(self, txt): + txt = re.sub(r"
$", "", txt) + return txt + # Setting/unsetting the current note ######################################################################