mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
MOBI Input: Correctly link stylesheet and declare encoding when converting to HTML
This commit is contained in:
parent
19a581fe57
commit
0c067c9151
@ -345,10 +345,13 @@ class MobiReader(object):
|
|||||||
root.insert(0, head)
|
root.insert(0, head)
|
||||||
head.text = '\n\t'
|
head.text = '\n\t'
|
||||||
link = head.makeelement('link', {'type':'text/css',
|
link = head.makeelement('link', {'type':'text/css',
|
||||||
'href':'styles.css'})
|
'href':'styles.css', 'rel':'stylesheet'})
|
||||||
head.insert(0, link)
|
head.insert(0, link)
|
||||||
link.tail = '\n\t'
|
link.tail = '\n\t'
|
||||||
title = head.xpath('descendant::title')
|
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:
|
if not title:
|
||||||
title = head.makeelement('title', {})
|
title = head.makeelement('title', {})
|
||||||
title.text = self.book_header.title
|
title.text = self.book_header.title
|
||||||
|
Loading…
x
Reference in New Issue
Block a user