Conversion pipeline: Fix crash caused by empty <style> elements. Fixes #775277 (Private bug)

This commit is contained in:
Kovid Goyal 2011-09-22 08:43:26 -06:00
parent f9dabe9140
commit 804c5d001f

View File

@ -216,7 +216,7 @@ class Stylizer(object):
if t: if t:
text += u'\n\n' + force_unicode(t, u'utf-8') text += u'\n\n' + force_unicode(t, u'utf-8')
if text: if text:
text = XHTML_CSS_NAMESPACE + elem.text text = XHTML_CSS_NAMESPACE + text
text = oeb.css_preprocessor(text) text = oeb.css_preprocessor(text)
stylesheet = parser.parseString(text, href=cssname) stylesheet = parser.parseString(text, href=cssname)
stylesheet.namespaces['h'] = XHTML_NS stylesheet.namespaces['h'] = XHTML_NS