View Single Post
Old 07-18-2017, 01:38 PM   #1216
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,893
Karma: 6120478
Join Date: Nov 2009
Device: many
Yes, the bug is in mobi_html.py where we explicitly look for url( style pieces in the css but do not handle that case:

Code:
url_pattern = re.compile(br'''(url\(.*?\))''', re.IGNORECASE)

url_img_index_pattern = re.compile(br'''[('"]kindle:embed:([0-9|A-V]+)\?mime=image/[^\)]*["')]''', re.IGNORECASE)

font_index_pattern = re.compile(br'''[('"]kindle:embed:([0-9|A-V]+)["')]''', re.IGNORECASE)

url_css_index_pattern = re.compile(br'''kindle:flow:([0-9|A-V]+)\?mime=text/css[^\)]*''', re.IGNORECASE)
I will try to use your example see how to best to handle the missing case of a kindle:flow but with a mime=image/svg+xml.

I think we can easily handle it as a special case by adding a:

url_svg_image_pattern = re.compile(br'''kindle:flow:([0-9|A-V]+)\?mime=image/svg+xml[^\)]*''', re.IGNORECASE)

and then handling it just like we handle inlined css flow urls.

Thanks,

KevinH

Last edited by KevinH; 07-18-2017 at 01:45 PM.
KevinH is offline   Reply With Quote