mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Conversion: When transliterating unicode characters, handle « and » correctly. Fixes #1117270 (Private bug)
This commit is contained in:
parent
fc055d626e
commit
186530f941
@ -626,7 +626,10 @@ class HTMLPreProcessor(object):
|
|||||||
|
|
||||||
if getattr(self.extra_opts, 'asciiize', False):
|
if getattr(self.extra_opts, 'asciiize', False):
|
||||||
from calibre.utils.localization import get_udc
|
from calibre.utils.localization import get_udc
|
||||||
|
from calibre.utils.mreplace import MReplace
|
||||||
unihandecoder = get_udc()
|
unihandecoder = get_udc()
|
||||||
|
mr = MReplace(data={u'«':u'<'*3, u'»':u'>'*3})
|
||||||
|
html = mr.mreplace(html)
|
||||||
html = unihandecoder.decode(html)
|
html = unihandecoder.decode(html)
|
||||||
|
|
||||||
if getattr(self.extra_opts, 'enable_heuristics', False):
|
if getattr(self.extra_opts, 'enable_heuristics', False):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user