mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
commit
2691875730
@ -335,6 +335,9 @@ class EditorWidget(QWebView): # {{{
|
|||||||
def fget(self):
|
def fget(self):
|
||||||
ans = u''
|
ans = u''
|
||||||
try:
|
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()
|
check = unicode(self.page().mainFrame().toPlainText()).strip()
|
||||||
raw = unicode(self.page().mainFrame().toHtml())
|
raw = unicode(self.page().mainFrame().toHtml())
|
||||||
raw = xml_to_unicode(raw, strip_encoding_pats=True,
|
raw = xml_to_unicode(raw, strip_encoding_pats=True,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user