mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-31 00:10:58 +01:00
Pull from driver-dev
This commit is contained in:
commit
2953e8c95b
1 changed files with 2 additions and 6 deletions
|
|
@ -60,6 +60,8 @@
|
|||
(re.compile(r'(?<=[^\\])\\X[0-4]'), lambda match: ''),
|
||||
(re.compile(r'(?<=[^\\])\\Sp'), lambda match: ''),
|
||||
(re.compile(r'(?<=[^\\])\\Sb'), lambda match: ''),
|
||||
# Remove invalid single item pml codes.
|
||||
(re.compile(r'(?<=[^\\])\\.'), lambda match: ''),
|
||||
|
||||
# Replace \\ with \.
|
||||
(re.compile(r'\\\\'), lambda match: '\\'),
|
||||
|
|
@ -70,12 +72,6 @@ def pml_to_html(pml):
|
|||
for rule in PML_HTML_RULES:
|
||||
html = rule[0].sub(rule[1], html)
|
||||
|
||||
# Turn special characters into entities.
|
||||
cps = [ord(c) for c in set(html)]
|
||||
cps = set(cps).intersection(codepoint2name.keys()).difference([60, 62])
|
||||
for cp in cps:
|
||||
html = html.replace(unichr(cp), '&%s;' % codepoint2name[cp])
|
||||
|
||||
return html
|
||||
|
||||
def footnote_sidebar_to_html(id, pml):
|
||||
|
|
|
|||
Loading…
Reference in a new issue