Fix #1998 ([ERROR] CSSStyleRule: No start { of style declaration found:)

This commit is contained in:
Kovid Goyal 2009-03-06 12:31:02 -08:00
parent cfeaed5c71
commit a6cf06dc25

View File

@ -797,7 +797,8 @@ class Processor(Parser):
self.external_stylesheets, self.stylesheet = [], self.css_parser.parseString('') self.external_stylesheets, self.stylesheet = [], self.css_parser.parseString('')
self.specified_override_css = [] self.specified_override_css = []
for link in self.root.xpath('//link'): for link in self.root.xpath('//link'):
if 'css' in link.get('type', 'text/css').lower(): ltype = link.get('type', link.get('rel', 'text/css')).lower()
if 'css' in ltype or 'style' in ltype:
file = os.path.join(self.tdir, *(link.get('href', '').split('/'))) file = os.path.join(self.tdir, *(link.get('href', '').split('/')))
if file and not 'http:' in file: if file and not 'http:' in file:
if not parsed_sheets.has_key(file): if not parsed_sheets.has_key(file):