mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #897531 (epub output do not add xml:lang from lang attribute)
This commit is contained in:
parent
4cb1907a13
commit
2e5f38a5bc
@ -132,9 +132,11 @@ class EPUBOutput(OutputFormatPlugin):
|
|||||||
|
|
||||||
def upshift_markup(self): # {{{
|
def upshift_markup(self): # {{{
|
||||||
'Upgrade markup to comply with XHTML 1.1 where possible'
|
'Upgrade markup to comply with XHTML 1.1 where possible'
|
||||||
from calibre.ebooks.oeb.base import XPath
|
from calibre.ebooks.oeb.base import XPath, XML
|
||||||
for x in self.oeb.spine:
|
for x in self.oeb.spine:
|
||||||
root = x.data
|
root = x.data
|
||||||
|
if (not root.get(XML('lang'))) and (root.get('lang')):
|
||||||
|
root.set(XML('lang'), root.get('lang'))
|
||||||
body = XPath('//h:body')(root)
|
body = XPath('//h:body')(root)
|
||||||
if body:
|
if body:
|
||||||
body = body[0]
|
body = body[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user