View Single Post
Old 06-03-2012, 09:44 AM   #383
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 74,206
Karma: 317184274
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
Ah - it seems to be the regular expression in mobi_html.py that's the problem. It didn't consider that there might be anything other than white space there.

That's a pretty simple fix, and shouldn't break anything. Just two lines need changing in mobi_html.py

Code:
link_pattern = re.compile(r'''<a([^>]*?)filepos=['"]{0,1}0*(\d+)['"]{0,1}([^>]*?)>''', re.IGNORECASE)
srctext = link_pattern.sub(r'''<a\1href="#filepos\2"\3>''', srctext)
I'm just testing it now, and if I get time I'll upload a fixed version later today. Perhaps even wrapped in a new version of the AppleScript too!
pdurrant is offline   Reply With Quote