This commit is contained in:
John Schember 2011-01-08 15:53:51 -05:00
parent c8f18ff02e
commit bd14205637

View File

@ -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)