diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index cd60e4fe25..aaa998ab75 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -88,6 +88,7 @@ def XLINK(name): def CALIBRE(name): return '{%s}%s' % (CALIBRE_NS, name) + _css_url_re = re.compile(r'url\s*\([\'"]{0,1}(.*?)[\'"]{0,1}\)', re.I) _css_import_re = re.compile(r'@import "(.*?)"') _archive_re = re.compile(r'[^ ]+') @@ -121,6 +122,7 @@ def itercsslinks(raw): for match in _css_import_re.finditer(raw): yield match.group(1), match.start(1) + _link_attrs = set(html.defs.link_attrs) | {XLINK('href'), 'poster'} @@ -402,6 +404,7 @@ def serialize(data, media_type, pretty_print=False): return data + b'\n' return bytes(data) + ASCII_CHARS = set(chr(x) for x in xrange(128)) UNIBYTE_CHARS = set(chr(x) for x in xrange(256)) URL_SAFE = set('ABCDEFGHIJKLMNOPQRSTUVWXYZ'