From c7da706c7bdaeaf9848472284ff9303defe9e1d8 Mon Sep 17 00:00:00 2001 From: MurakamiShinyu Date: Thu, 25 Mar 2021 01:40:30 +0900 Subject: [PATCH] fix: Failed to load documents from URL that contains "%26" or "%3F" etc. Fixes #711 --- packages/core/src/vivliostyle/epub.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/vivliostyle/epub.ts b/packages/core/src/vivliostyle/epub.ts index 62c0e13bd..2f9a340f0 100644 --- a/packages/core/src/vivliostyle/epub.ts +++ b/packages/core/src/vivliostyle/epub.ts @@ -857,7 +857,7 @@ export class OPFDoc { epubBaseURL += "/"; } return url.substr(0, epubBaseURL.length) == epubBaseURL - ? decodeURI(url.substr(epubBaseURL.length)) + ? decodeURIComponent(url.substr(epubBaseURL.length)) : null; } else { return url; @@ -1013,7 +1013,7 @@ export class OPFDoc { const entry = zipMetadata[i]; const encodedPath = entry["n"]; if (encodedPath) { - const path = decodeURI(encodedPath); + const path = decodeURIComponent(encodedPath); const item = this.itemMapByPath[path]; let mediaType: string | null = null; if (item) {