Skip to content

Commit

Permalink
Fix failure to display URLs ending in question mark #654 (#655)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaifroid authored Sep 29, 2024
1 parent 7488352 commit ab6895f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6722,7 +6722,9 @@ function displayArticleContentInContainer (dirEntry, htmlArticle) {
transDirEntry = dirEntry;
// We will need the encoded URL on article load so that we can set the iframe's src correctly,
// but we must not encode the '/' character or else relative links may fail [kiwix-js #498]
var encodedUrl = /zimit/.test(params.zimType) ? dirEntry.url : encodeURI(dirEntry.url);
var encodedUrl = dirEntry.url.replace(/[^/]+/g, function (matchedSubstring) {
return encodeURIComponent(matchedSubstring);
});
// If the request was not initiated by an existing controlled window, we instantiate the request here
if (!messageChannelWaiting) {
// We put the ZIM filename as a prefix in the URL, so that browser caches are separate for each ZIM file
Expand Down

0 comments on commit ab6895f

Please sign in to comment.