mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 17:26:36 -04:00
filter html editor html
This commit is contained in:
parent
e177fae220
commit
0bb4633b14
1 changed files with 5 additions and 2 deletions
|
@ -515,8 +515,11 @@ class Editor(object):
|
||||||
form.textEdit.setPlainText(self.note.fields[self.currentField])
|
form.textEdit.setPlainText(self.note.fields[self.currentField])
|
||||||
form.textEdit.moveCursor(QTextCursor.End)
|
form.textEdit.moveCursor(QTextCursor.End)
|
||||||
d.exec_()
|
d.exec_()
|
||||||
self.note.fields[self.currentField] = unicode(
|
html = form.textEdit.toPlainText()
|
||||||
form.textEdit.toPlainText())
|
# filter html through beautifulsoup so we can strip out things like a
|
||||||
|
# leading </div>
|
||||||
|
html = unicode(BeautifulSoup(html))
|
||||||
|
self.note.fields[self.currentField] = html
|
||||||
self.loadNote()
|
self.loadNote()
|
||||||
|
|
||||||
# Tag & deck handling
|
# Tag & deck handling
|
||||||
|
|
Loading…
Reference in a new issue