This commit is contained in:
Kovid Goyal 2017-01-13 09:06:09 +05:30
parent 5ef48e96c3
commit 25e51e968f

View File

@ -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'