From 5c836316744ec2da863f5873a87555451467401b Mon Sep 17 00:00:00 2001 From: YishaiGlasner Date: Mon, 6 Jan 2025 14:20:07 +0200 Subject: [PATCH] fix(acquire api-v3 text): encode versions uri for versionTitles that have semi colon. --- static/js/sefaria/sefaria.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/static/js/sefaria/sefaria.js b/static/js/sefaria/sefaria.js index bad5bc20a6..e05bd4e7d4 100644 --- a/static/js/sefaria/sefaria.js +++ b/static/js/sefaria/sefaria.js @@ -534,11 +534,13 @@ Sefaria = extend(Sefaria, { return Promise.all(promises).then(results => Object.assign({}, ...results)); }, makeParamsStringForAPIV3: function(language, versionTitle) { + let versionParamsString; if (versionTitle) { - return `${language}|${versionTitle}`; + versionParamsString = `${language}|${versionTitle}`; } else if (language) { - return language; + versionParamsString = language; } + return encodeURIComponent(versionParamsString); }, makeUrlForAPIV3Text: function(ref, requiredVersions, mergeText, return_format) { const host = Sefaria.apiHost;