mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-02-02 05:51:13 +01:00
TXT Input: Convert HTML entities to characters. Fixes #6114 (markdown lines with HTML UNICODE character sequences not converting correctly.)
This commit is contained in:
parent
f2c6baf630
commit
ec607dc596
1 changed files with 3 additions and 0 deletions
|
|
@ -10,6 +10,7 @@
|
|||
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 @@ def convert(self, stream, options, file_ext, log,
|
|||
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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue