From aa61d8892e3d4137cc5b0c977226949b771e7529 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 14 Sep 2009 14:47:34 -0600 Subject: [PATCH] HTML Input: Ignore case when parsing the rel and type attributes of tags for CSS stylesheets --- src/calibre/ebooks/oeb/stylizer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index 4c0b8a1573..a282b0c2fc 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -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)