TXT Input: Convert HTML entities to characters. Fixes #6114 (markdown lines with HTML UNICODE character sequences not converting correctly.)

This commit is contained in:
Kovid Goyal 2010-07-09 10:08:00 -06:00
parent f2c6baf630
commit ec607dc596

View File

@ -10,6 +10,7 @@ from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation
from calibre.ebooks.txt.processor import convert_basic, convert_markdown, \
separate_paragraphs_single_line, separate_paragraphs_print_formatted, \
preserve_spaces
from calibre import _ent_pat, xml_entity_to_unicode
class TXTInput(InputFormatPlugin):
@ -55,6 +56,8 @@ class TXTInput(InputFormatPlugin):
if options.preserve_spaces:
txt = preserve_spaces(txt)
txt = _ent_pat.sub(xml_entity_to_unicode, txt)
if options.markdown:
log.debug('Running text though markdown conversion...')
try: