Skip sanitizing in comments editor when special <meta> tag detected.

This commit is contained in:
Gregory Riker 2014-02-18 05:57:26 -07:00
parent 5f07a78b0a
commit 264450ac5a

View File

@ -343,6 +343,10 @@ class EditorWidget(QWebView): # {{{
if not check and '<img' not in raw.lower(): if not check and '<img' not in raw.lower():
return ans return ans
# Bypass cleanup if special meta tag exists
if '<meta name="calibre-dont-sanitize">' in raw.lower():
return unicode(self.page().mainFrame().toHtml())
try: try:
root = html.fromstring(raw) root = html.fromstring(raw)
except: except: