mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
MOBI Output: When the same anchor is present more than once in the input document, use the first occurence rather than the last one. Fixes #934031 (link destination is wrong in case of html -> mobi conversion)
This commit is contained in:
parent
1b5d0a6038
commit
1249a15570
@ -306,7 +306,9 @@ class Serializer(object):
|
||||
if id_:
|
||||
href = '#'.join((item.href, id_))
|
||||
offset = self.anchor_offset or buf.tell()
|
||||
self.id_offsets[urlnormalize(href)] = offset
|
||||
key = urlnormalize(href)
|
||||
if key not in self.id_offsets:
|
||||
self.id_offsets[urlnormalize(href)] = offset
|
||||
if self.anchor_offset is not None and \
|
||||
tag == 'a' and not elem.attrib and \
|
||||
not len(elem) and not elem.text:
|
||||
|
Loading…
x
Reference in New Issue
Block a user