From 118d0aa0ce06ca20b3d7384fdd420526155bd384 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 11 Jun 2009 12:16:05 -0700 Subject: [PATCH] Fix #2578 (ePub output does not seem to work with ADE for Windows) --- src/calibre/ebooks/oeb/base.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index 244acf7627..3e16e73ab9 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -810,6 +810,12 @@ class Manifest(object): r = [x for x in data.iterdescendants(etree.Element) if 'microsoft-com' in x.tag] for x in r: x.tag = XHTML('span') + + # Remove lang redefinition inserted by the amazing Microsoft Word! + body = xpath(data, '/h:html/h:body')[0] + for key in list(body.attrib.keys()): + if key == 'lang' or key.endswith('}lang'): + body.attrib.pop(key) return data def _parse_css(self, data):