mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 13:57:23 +02:00
IGN:PML Output: Replace non breaking spaces with normal spaces
This commit is contained in:
parent
53f7cdec0b
commit
1d7c3277ec
1 changed files with 4 additions and 0 deletions
|
|
@ -153,6 +153,10 @@ def clean_text(self, text):
|
|||
for unused in anchors.difference(links):
|
||||
text = text.replace('\\Q="%s"' % unused, '')
|
||||
|
||||
# Replace bad characters.
|
||||
text = text.replace(u'\xc2', '')
|
||||
text = text.replace(u'\xa0', ' ')
|
||||
|
||||
# Turn all html entities into unicode. This should not be necessary as
|
||||
# lxml should have already done this but we want to be sure it happens.
|
||||
for entity in set(re.findall('&.+?;', text)):
|
||||
|
|
|
|||
Loading…
Reference in a new issue