mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
AZW3 input: Put internal links into quotes to avoid parse errors when tweaking
This commit is contained in:
parent
95ed2862a6
commit
c7aa9c78fb
@ -45,7 +45,8 @@ def update_internal_links(mobi8_reader, log):
|
|||||||
suffix = (b'#' + idtag) if idtag else b''
|
suffix = (b'#' + idtag) if idtag else b''
|
||||||
replacement = filename.split('/')[-1].encode(
|
replacement = filename.split('/')[-1].encode(
|
||||||
mr.header.codec) + suffix
|
mr.header.codec) + suffix
|
||||||
tag = posfid_index_pattern.sub(replacement, tag, 1)
|
replacement = replacement.replace(b'"', b'"')
|
||||||
|
tag = posfid_index_pattern.sub(b'"' + replacement + b'"', tag, 1)
|
||||||
srcpieces[j] = tag
|
srcpieces[j] = tag
|
||||||
raw = b''.join(srcpieces)
|
raw = b''.join(srcpieces)
|
||||||
parts.append(raw.decode(mr.header.codec))
|
parts.append(raw.decode(mr.header.codec))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user