need to strip trailing <br /> when saving fields

This commit is contained in:
Damien Elmes 2013-05-20 15:38:05 +09:00
parent 85cb7ef47e
commit f10b336fb9

View file

@ -518,6 +518,8 @@ class Editor(object):
# reverse the url quoting we added to get images to display # reverse the url quoting we added to get images to display
txt = unicode(urllib2.unquote( txt = unicode(urllib2.unquote(
txt.encode("utf8")), "utf8", "replace") txt.encode("utf8")), "utf8", "replace")
# make sure a trailing <br /> is removed
txt = re.sub("(<br />)*$", "", txt)
self.note.fields[self.currentField] = txt self.note.fields[self.currentField] = txt
if not self.addMode: if not self.addMode:
self.note.flush() self.note.flush()