From ec607dc596c03cf00901bda3f702b8a069a4b13a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 9 Jul 2010 10:08:00 -0600 Subject: [PATCH] TXT Input: Convert HTML entities to characters. Fixes #6114 (markdown lines with HTML UNICODE character sequences not converting correctly.) --- src/calibre/ebooks/txt/input.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/ebooks/txt/input.py b/src/calibre/ebooks/txt/input.py index cce7bea519..b444bf1cf4 100644 --- a/src/calibre/ebooks/txt/input.py +++ b/src/calibre/ebooks/txt/input.py @@ -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: