HTML Input: Ignore case when parsing the rel and type attributes of <link> tags for CSS stylesheets

This commit is contained in:
Kovid Goyal 2009-09-14 14:47:34 -06:00
parent ff7c39237a
commit aa61d8892e

View File

@ -132,8 +132,8 @@ class Stylizer(object):
stylesheet.namespaces['h'] = XHTML_NS
stylesheets.append(stylesheet)
elif elem.tag == XHTML('link') and elem.get('href') \
and elem.get('rel', 'stylesheet') == 'stylesheet' \
and elem.get('type', CSS_MIME) in OEB_STYLES:
and elem.get('rel', 'stylesheet').lower() == 'stylesheet' \
and elem.get('type', CSS_MIME).lower() in OEB_STYLES:
href = urlnormalize(elem.attrib['href'])
path = item.abshref(href)
sitem = oeb.manifest.hrefs.get(path, None)