This commit is contained in:
Kovid Goyal 2014-01-09 11:47:44 +05:30
parent b4feff193b
commit ef6b0193a8

View File

@ -58,7 +58,7 @@ def link_stylesheets(container, names, sheets, remove=False, mtype='text/css'):
try: try:
parent = hp(root)[0] parent = hp(root)[0]
except (TypeError, IndexError): except (TypeError, IndexError):
parent = XHTML('head') parent = root.makeelement(XHTML('head'))
container.insert_into_xml(root, parent, index=0) container.insert_into_xml(root, parent, index=0)
for sheet in sheets: for sheet in sheets:
if sheet in extra: if sheet in extra: