mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
MOBI Input: Fix links not working in viewer for MOBI files that contain anchors placed on linebreak elements. Fixes #1439450 [Private bug](https://bugs.launchpad.net/calibre/+bug/1439450)
This commit is contained in:
parent
9919a1f4c0
commit
57a8c0e8a5
@ -385,8 +385,7 @@ class MobiReader(object):
|
||||
svg_tags = []
|
||||
forwardable_anchors = []
|
||||
pagebreak_anchors = []
|
||||
BLOCK_TAGS = {'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
|
||||
'div', 'p'}
|
||||
BLOCK_TAGS = {'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'p'}
|
||||
for i, tag in enumerate(root.iter(etree.Element)):
|
||||
tag.attrib.pop('xmlns', '')
|
||||
for x in tag.attrib:
|
||||
@ -583,6 +582,10 @@ class MobiReader(object):
|
||||
else:
|
||||
block.attrib['id'] = tag.attrib['id']
|
||||
|
||||
# WebKit fails to navigate to anchors located on <br> tags
|
||||
for br in root.xpath('/body/br[@id]'):
|
||||
br.tag = 'div'
|
||||
|
||||
def get_left_whitespace(self, tag):
|
||||
|
||||
def whitespace(tag):
|
||||
|
Loading…
x
Reference in New Issue
Block a user