Fix #4474 (Note of page in epub/picture in mobi)

This commit is contained in:
Kovid Goyal 2010-01-10 15:40:13 -07:00
parent dbbed21599
commit 20fe1609e4
2 changed files with 150 additions and 145 deletions

View File

@ -264,6 +264,11 @@ class EPUBOutput(OutputFormatPlugin):
if body:
body = body[0]
# Add id attribute to <a> tags that have name
for x in XPath('//h:a[@name]')(body):
if not x.get('id', False):
x.set('id', x.get('name'))
# Replace <br> that are children of <body> as ADE doesn't handle them
if hasattr(body, 'xpath'):
for br in XPath('./h:br')(body):