Skip to content

Commit

Permalink
Merge pull request #2215 from Sefaria/encode-uri
Browse files Browse the repository at this point in the history
fix(acquire api-v3 text): encode versions uri for versionTitles that …
  • Loading branch information
akiva10b authored Jan 6, 2025
2 parents 23b4a60 + 5c83631 commit 89d5e7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions static/js/sefaria/sefaria.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 89d5e7c

Please sign in to comment.