mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
2d6b895a90
commit
7711d58021
@ -444,6 +444,9 @@ xml_entity_to_unicode = partial(entity_to_unicode, result_exceptions = {
|
|||||||
def replace_entities(raw):
|
def replace_entities(raw):
|
||||||
return _ent_pat.sub(entity_to_unicode, raw)
|
return _ent_pat.sub(entity_to_unicode, raw)
|
||||||
|
|
||||||
|
def xml_replace_entities(raw):
|
||||||
|
return _ent_pat.sub(xml_entity_to_unicode, raw)
|
||||||
|
|
||||||
def prepare_string_for_xml(raw, attribute=False):
|
def prepare_string_for_xml(raw, attribute=False):
|
||||||
raw = _ent_pat.sub(entity_to_unicode, raw)
|
raw = _ent_pat.sub(entity_to_unicode, raw)
|
||||||
raw = raw.replace('&', '&').replace('<', '<').replace('>', '>')
|
raw = raw.replace('&', '&').replace('<', '<').replace('>', '>')
|
||||||
|
@ -213,11 +213,13 @@ class BookInfo(QWebView):
|
|||||||
f = QFontInfo(QApplication.font(self.parent())).pixelSize()
|
f = QFontInfo(QApplication.font(self.parent())).pixelSize()
|
||||||
p = unicode(QApplication.palette().color(QPalette.Normal,
|
p = unicode(QApplication.palette().color(QPalette.Normal,
|
||||||
QPalette.Base).name())
|
QPalette.Base).name())
|
||||||
|
c = unicode(QApplication.palette().color(QPalette.Normal,
|
||||||
|
QPalette.Text).name())
|
||||||
templ = u'''\
|
templ = u'''\
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body, td {background-color: %s; font-size: %dpx}
|
body, td {background-color: %s; font-size: %dpx; color: %s }
|
||||||
a { text-decoration: none; color: blue }
|
a { text-decoration: none; color: blue }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
@ -225,7 +227,7 @@ class BookInfo(QWebView):
|
|||||||
%%s
|
%%s
|
||||||
</body>
|
</body>
|
||||||
<html>
|
<html>
|
||||||
'''%(p, f)
|
'''%(p, f, c)
|
||||||
if self.vertical:
|
if self.vertical:
|
||||||
if comments:
|
if comments:
|
||||||
rows += u'<tr><td colspan="2">%s</td></tr>'%comments
|
rows += u'<tr><td colspan="2">%s</td></tr>'%comments
|
||||||
|
104
src/calibre/gui2/comments_editor.py
Normal file
104
src/calibre/gui2/comments_editor.py
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user