Reinstate mungeHTML in editor.py

The removal of this function in #270 causes <br> to remain in seemingly
empty editor fields, which in turn wrongly prompts the "Close and lose
current input?" dialog.
This commit is contained in:
zjosua 2019-01-25 23:12:48 +01:00
parent fcfb45ccdf
commit 4981fa187a

View File

@ -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"<br>$", "", txt)
return txt
# Setting/unsetting the current note
######################################################################