mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
AZW3 Input: Fix rare AID based links not working. Fixes #1898394 [Error generating TOC on AZW3 format](https://bugs.launchpad.net/calibre/+bug/1898394)
This commit is contained in:
parent
6b10773c24
commit
26998b0a59
@ -335,7 +335,7 @@ def expand_mobi8_markup(mobi8_reader, resource_map, log):
|
||||
parts = update_internal_links(mobi8_reader, log)
|
||||
|
||||
# Remove pointless markup inserted by kindlegen
|
||||
remove_kindlegen_markup(parts, mobi8_reader.aid_anchor_suffix, mobi8_reader.linked_aids)
|
||||
remove_kindlegen_markup(parts, mobi8_reader.aid_anchor_suffix.decode('utf-8'), mobi8_reader.linked_aids)
|
||||
|
||||
# Handle substitutions for the flows pieces first as they may
|
||||
# be inlined into the xhtml text
|
||||
|
@ -337,7 +337,7 @@ class Mobi8Reader(object):
|
||||
# See https://www.mobileread.com/forums/showthread.php?t=259557
|
||||
m = self.aid_re.match(tag)
|
||||
if m is not None:
|
||||
self.linked_aids.add(m.group(1))
|
||||
self.linked_aids.add(m.group(1).decode('utf-8'))
|
||||
return m.group(1) + b'-' + self.aid_anchor_suffix
|
||||
|
||||
# No tag found, link to start of file
|
||||
|
Loading…
x
Reference in New Issue
Block a user