Skip to content

Commit

Permalink
Merge pull request #2041 from Sefaria/versionTitle-bug
Browse files Browse the repository at this point in the history
fix(url): use encodeURIComponent on versionTitle for avoiding semicolons to be replaced by ampersand
  • Loading branch information
YishaiGlasner authored Sep 18, 2024
2 parents c310057 + ac9e946 commit b2f10e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion static/js/VersionBlock/VersionBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class VersionBlockUtils {
console.log(err);
}
if (renderMode === 'book-page') {
window.location = `/${firstSectionRef}?v${version.language}=${version.versionTitle.replace(/\s/g,'_')}`;
let urlVersionTitle = encodeURIComponent(version.versionTitle.replace(/\s/g,'_'));
window.location = `/${firstSectionRef}?v${version.language}=${urlVersionTitle}`;
} else {
openVersionInReader(version.versionTitle, version.language);
}
Expand Down

0 comments on commit b2f10e9

Please sign in to comment.