mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
need to strip trailing <br /> when saving fields
This commit is contained in:
parent
85cb7ef47e
commit
f10b336fb9
1 changed files with 2 additions and 0 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue