mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
MOBI Output: Fix bug that could cause a link pointing to the start of a section to go to a point later in the section is the section contained an empty id attribute
This commit is contained in:
parent
8f81ccaa04
commit
f965037fb4
@ -251,7 +251,7 @@ class Serializer(object):
|
|||||||
tag = prefixname(elem.tag, nsrmap)
|
tag = prefixname(elem.tag, nsrmap)
|
||||||
# Previous layers take care of @name
|
# Previous layers take care of @name
|
||||||
id = elem.attrib.pop('id', None)
|
id = elem.attrib.pop('id', None)
|
||||||
if id is not None:
|
if id:
|
||||||
href = '#'.join((item.href, id))
|
href = '#'.join((item.href, id))
|
||||||
offset = self.anchor_offset or buffer.tell()
|
offset = self.anchor_offset or buffer.tell()
|
||||||
self.id_offsets[urlnormalize(href)] = offset
|
self.id_offsets[urlnormalize(href)] = offset
|
||||||
|
Loading…
x
Reference in New Issue
Block a user