mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
c8f18ff02e
commit
bd14205637
@ -5,7 +5,6 @@ __copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
|||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import string
|
|
||||||
|
|
||||||
from calibre import prepare_string_for_xml
|
from calibre import prepare_string_for_xml
|
||||||
from calibre.ebooks.unidecode.unidecoder import Unidecoder
|
from calibre.ebooks.unidecode.unidecoder import Unidecoder
|
||||||
@ -48,7 +47,7 @@ class TXTHeuristicProcessor(object):
|
|||||||
processed = []
|
processed = []
|
||||||
for line in txt.split('\n\n'):
|
for line in txt.split('\n\n'):
|
||||||
processed.append(u'<p>%s</p>' % self.process_paragraph(prepare_string_for_xml(line.replace('\n', ' '))))
|
processed.append(u'<p>%s</p>' % self.process_paragraph(prepare_string_for_xml(line.replace('\n', ' '))))
|
||||||
|
|
||||||
txt = u'\n'.join(processed)
|
txt = u'\n'.join(processed)
|
||||||
txt = re.sub('[ ]{2,}', ' ', txt)
|
txt = re.sub('[ ]{2,}', ' ', txt)
|
||||||
html = HTML_TEMPLATE % (title, txt)
|
html = HTML_TEMPLATE % (title, txt)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user