Allow disabling of comment sanitizing in the comments editor via a special meta tag <meta name="calibre-dont-sanitize">

Merge branch 'master' of https://github.com/GRiker/calibre
This commit is contained in:
Kovid Goyal 2014-02-18 19:02:18 +05:30
commit 2691875730

View File

@ -335,6 +335,9 @@ class EditorWidget(QWebView): # {{{
def fget(self):
ans = u''
try:
if not self.page().mainFrame().documentElement().findFirst('meta[name="calibre-dont-sanitize"]').isNull():
# Bypass cleanup if special meta tag exists
return unicode(self.page().mainFrame().toHtml())
check = unicode(self.page().mainFrame().toPlainText()).strip()
raw = unicode(self.page().mainFrame().toHtml())
raw = xml_to_unicode(raw, strip_encoding_pats=True,