From 5c7dd6520ac363c2d01a7f70a8080fdc54094e6a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 20 Oct 2009 17:22:38 -0600 Subject: [PATCH] Fix #3806 (Conversion of eReader PDB to ePub breaks footnotes!) --- src/calibre/ebooks/pml/pmlconverter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/calibre/ebooks/pml/pmlconverter.py b/src/calibre/ebooks/pml/pmlconverter.py index c72a21a5f9..7133e3f251 100644 --- a/src/calibre/ebooks/pml/pmlconverter.py +++ b/src/calibre/ebooks/pml/pmlconverter.py @@ -41,14 +41,14 @@ PML_HTML_RULES = [ (re.compile(r'\\q="(?P#.+?)"(?P.*?)\\q', re.DOTALL), lambda match: '%s' % (match.group('target'), match.group('text')) if match.group('text') else ''), (re.compile(r'\\Q="(?P.+?)"'), lambda match: '' % match.group('target')), (re.compile(r'\\-'), lambda match: ''), - (re.compile(r'\\Fn="(?P.+?)"(?P.*?)\\Fn'), lambda match: '%s' % (match.group('target'), match.group('text')) if match.group('text') else ''), - (re.compile(r'\\Sd="(?P.+?)"(?P.*?)\\Sd'), lambda match: '%s' % (match.group('target'), match.group('text')) if match.group('text') else ''), + (re.compile(r'\\Fn="(?P.+?)"(?P.*?)\\Fn'), lambda match: '%s' % (match.group('target'), match.group('text')) if match.group('text') else ''), + (re.compile(r'\\Sd="(?P.+?)"(?P.*?)\\Sd'), lambda match: '%s' % (match.group('target'), match.group('text')) if match.group('text') else ''), # Just italicize index items as that is how the eReader software renders them. (re.compile(r'\\I(?P.*?)\\I', re.DOTALL), lambda match: '%s' % match.group('text') if match.group('text') else ''), # Sidebar and Footnotes - (re.compile(r'.+?)">\s*(?P.*?)\s*', re.DOTALL), lambda match: '' % (match.group('target'), match.group('text')) if match.group('text') else ''), - (re.compile(r'.+?)">\s*(?P.*?)\s*', re.DOTALL), lambda match: '
%s
' % (match.group('target'), match.group('text')) if match.group('text') else ''), + (re.compile(r'.+?)">\s*(?P.*?)\s*', re.DOTALL), lambda match: '
%s
' % (match.group('target'), match.group('text')) if match.group('text') else ''), + (re.compile(r'.+?)">\s*(?P.*?)\s*', re.DOTALL), lambda match: '
%s
' % (match.group('target'), match.group('text')) if match.group('text') else ''), # eReader files are one paragraph per line. # This forces the lines to wrap properly. @@ -80,5 +80,5 @@ def pml_to_html(pml): def footnote_sidebar_to_html(id, pml): if id.startswith('\x01'): id = id[2:] - html = '
%s
' % (id, id, pml_to_html(pml)) + html = '
%s
%s
' % (id, id, pml_to_html(pml)) return html