This commit is contained in:
Kovid Goyal 2012-02-23 13:42:48 +05:30
parent 1249a15570
commit 3697256c45

View File

@ -307,8 +307,8 @@ class Serializer(object):
href = '#'.join((item.href, id_)) href = '#'.join((item.href, id_))
offset = self.anchor_offset or buf.tell() offset = self.anchor_offset or buf.tell()
key = urlnormalize(href) key = urlnormalize(href)
if key not in self.id_offsets: # Only set this id_offset if it wasn't previously seen
self.id_offsets[urlnormalize(href)] = offset self.id_offsets[key] = self.id_offsets.get(key, offset)
if self.anchor_offset is not None and \ if self.anchor_offset is not None and \
tag == 'a' and not elem.attrib and \ tag == 'a' and not elem.attrib and \
not len(elem) and not elem.text: not len(elem) and not elem.text: