filter html editor html

This commit is contained in:
Damien Elmes 2012-03-27 06:18:07 +09:00
parent e177fae220
commit 0bb4633b14

View file

@ -515,8 +515,11 @@ class Editor(object):
form.textEdit.setPlainText(self.note.fields[self.currentField])
form.textEdit.moveCursor(QTextCursor.End)
d.exec_()
self.note.fields[self.currentField] = unicode(
form.textEdit.toPlainText())
html = 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()
# Tag & deck handling