Skip to content

Commit

Permalink
refactor(url): use encodeURIComponent rather than manually replacing …
Browse files Browse the repository at this point in the history
…semicolon.
  • Loading branch information
YishaiGlasner committed Sep 18, 2024
1 parent 9dc6e58 commit ac9e946
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion static/js/VersionBlock/VersionBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class VersionBlockUtils {
console.log(err);
}
if (renderMode === 'book-page') {
let urlVersionTitle = version.versionTitle.replace(/\s/g,'_').replace(';', '%3B');
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 ac9e946

Please sign in to comment.