mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
AZW3 Output: Fix handling of & < and > entities in the text. They were being incorrectly unescaped.
This commit is contained in:
parent
e5d1e81e17
commit
761cb5509c
@ -10,6 +10,7 @@ __docformat__ = 'restructuredtext en'
|
|||||||
import re
|
import re
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
from xml.sax.saxutils import escape
|
||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
@ -289,6 +290,7 @@ class Chunker(object):
|
|||||||
self.chunk_selector = ('S', aid)
|
self.chunk_selector = ('S', aid)
|
||||||
|
|
||||||
def chunk_up_text(self, text):
|
def chunk_up_text(self, text):
|
||||||
|
text = escape(text)
|
||||||
text = text.encode('utf-8')
|
text = text.encode('utf-8')
|
||||||
ans = []
|
ans = []
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user