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:
parent
fcfb45ccdf
commit
4981fa187a
@ -254,6 +254,7 @@ class Editor:
|
|||||||
return
|
return
|
||||||
txt = urllib.parse.unquote(txt)
|
txt = urllib.parse.unquote(txt)
|
||||||
txt = unicodedata.normalize("NFC", txt)
|
txt = unicodedata.normalize("NFC", txt)
|
||||||
|
txt = self.mungeHTML(txt)
|
||||||
# misbehaving apps may include a null byte in the text
|
# misbehaving apps may include a null byte in the text
|
||||||
txt = txt.replace("\x00", "")
|
txt = txt.replace("\x00", "")
|
||||||
# reverse the url quoting we added to get images to display
|
# reverse the url quoting we added to get images to display
|
||||||
@ -285,6 +286,10 @@ class Editor:
|
|||||||
else:
|
else:
|
||||||
print("uncaught cmd", cmd)
|
print("uncaught cmd", cmd)
|
||||||
|
|
||||||
|
def mungeHTML(self, txt):
|
||||||
|
txt = re.sub(r"<br>$", "", txt)
|
||||||
|
return txt
|
||||||
|
|
||||||
# Setting/unsetting the current note
|
# Setting/unsetting the current note
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user