mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Fix #4474 (Note of page in epub/picture in mobi)
This commit is contained in:
parent
dbbed21599
commit
20fe1609e4
@ -264,6 +264,11 @@ class EPUBOutput(OutputFormatPlugin):
|
|||||||
if body:
|
if body:
|
||||||
body = body[0]
|
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
|
# Replace <br> that are children of <body> as ADE doesn't handle them
|
||||||
if hasattr(body, 'xpath'):
|
if hasattr(body, 'xpath'):
|
||||||
for br in XPath('./h:br')(body):
|
for br in XPath('./h:br')(body):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user