View Single Post
Old 01-25-2012, 05:19 AM   #1
Olger
Member
Olger began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Nov 2011
Device: Kobo Touch
replacing html character

Hi All,

I've tried pretty much all I can, but I'm just not used to python, prefer php actually. Anyway, I'm encountering some html characters that are not displayed correctly on my ereader.
So I've tried to use:
preprocess_regexps = [
(re.compile(r"—", re.IGNORECASE | re.DOTALL), lambda match: "--"),
]

to replace the — with -- (or any other character). Ain't working. The html character is removed, but not replaced.
I haven't been able to find much doco on how to use the compile function either.
Anybody able to help out?
Cheers! Olger
Olger is offline   Reply With Quote