MOBI Input: Correctly link stylesheet and declare encoding when converting to HTML

This commit is contained in:
Kovid Goyal 2009-07-05 12:26:44 -06:00
parent 19a581fe57
commit 0c067c9151

View File

@ -345,10 +345,13 @@ class MobiReader(object):
root.insert(0, head)
head.text = '\n\t'
link = head.makeelement('link', {'type':'text/css',
'href':'styles.css'})
'href':'styles.css', 'rel':'stylesheet'})
head.insert(0, link)
link.tail = '\n\t'
title = head.xpath('descendant::title')
m = head.makeelement('meta', {'http-equiv':'Content-Type',
'content':'text/html; charset=utf-8'})
head.insert(0, m)
if not title:
title = head.makeelement('title', {})
title.text = self.book_header.title