From 2e5f38a5bc9bbf14500ae3c11fd2ddda5b01c149 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 29 Nov 2011 11:25:11 +0530 Subject: [PATCH] Fix #897531 (epub output do not add xml:lang from lang attribute) --- src/calibre/ebooks/epub/output.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/epub/output.py b/src/calibre/ebooks/epub/output.py index bb515f95a4..52bbfb4a08 100644 --- a/src/calibre/ebooks/epub/output.py +++ b/src/calibre/ebooks/epub/output.py @@ -132,9 +132,11 @@ class EPUBOutput(OutputFormatPlugin): def upshift_markup(self): # {{{ '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: 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) if body: body = body[0]