Conversion pipeline: Fix bug that was causing @page rules in CSS embedded in <style> tags to not be stripped. This fixes the problem of EPUB files converted from the HTML output of Microsoft Word having large margins.

This commit is contained in:
Kovid Goyal 2009-09-04 15:19:03 -06:00
parent 5fd1812579
commit 07b1efef27

View File

@ -127,6 +127,7 @@ class Stylizer(object):
if elem.tag == XHTML('style') and elem.text \ if elem.tag == XHTML('style') and elem.text \
and elem.get('type', CSS_MIME) in OEB_STYLES: and elem.get('type', CSS_MIME) in OEB_STYLES:
text = XHTML_CSS_NAMESPACE + elem.text text = XHTML_CSS_NAMESPACE + elem.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
stylesheets.append(stylesheet) stylesheets.append(stylesheet)