From b12cd7ab03051c1010389306b29da0704b43f8d8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 7 Dec 2013 10:11:03 +0530 Subject: [PATCH] EPUB Output: Remove name attribute from tags to keep the asinine epubcheck happy --- src/calibre/ebooks/conversion/plugins/epub_output.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/ebooks/conversion/plugins/epub_output.py b/src/calibre/ebooks/conversion/plugins/epub_output.py index 254c50dbe6..90af27d4d2 100644 --- a/src/calibre/ebooks/conversion/plugins/epub_output.py +++ b/src/calibre/ebooks/conversion/plugins/epub_output.py @@ -379,6 +379,9 @@ class EPUBOutput(OutputFormatPlugin): for x in XPath('//h:a[@name]')(body): if not x.get('id', False): x.set('id', x.get('name')) + # The delightful epubcheck has started complaining about tags that + # have name attributes. + x.attrib.pop('name') # Replace
that are children of as ADE doesn't handle them for br in XPath('./h:br')(body):