Skip to content

Commit

Permalink
Cleanup and ensure encoding happens correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Zuber committed Jan 29, 2023
1 parent ee86fb5 commit 876eb2d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions offlineSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import {
} from "./types";
import { parseRange } from "./utils";

const baseChumashLink =
'https://www.sefaria.org/api/texts/$book?vhe=$hebrewVersion&ven=$englishVersion&context=0&pad=0'
'https://raw.githubusercontent.com/Sefaria/Sefaria-Export/master/json/Tanakh/Torah/$book/$language/merged.json';
const baseChumashLink = 'https://www.sefaria.org/api/texts/$book?vhe=$hebrewVersion&ven=$englishVersion&context=0&pad=0';
const getChumashLink = (book: BookName, hebrewVersion: HebrewTextVersionOptions, englishVersion: EnglishTextVersionOptions) =>
baseChumashLink
.replace('$book', book)
Expand All @@ -18,7 +16,7 @@ const getChumashLink = (book: BookName, hebrewVersion: HebrewTextVersionOptions,

// For right now Targum and Rashi versions are hardcoded
const targumVersion: TargumVersionOptions = 'Sifsei Chachomim Chumash, Metsudah Publications, 2009';
const baseTargumLink = `https://raw.githubusercontent.com/Sefaria/Sefaria-Export/master/json/Tanakh/Targum/Onkelos/Torah/Onkelos%20$book/Hebrew/${targumVersion}.json`;
const baseTargumLink = `https://raw.githubusercontent.com/Sefaria/Sefaria-Export/master/json/Tanakh/Targum/Onkelos/Torah/Onkelos $book/Hebrew/${targumVersion}.json`;
const getTargumLink = (book: BookName) => encodeURI(baseTargumLink.replace('$book', book));
const targumLinks = {
[BookName.Genesis]: getTargumLink(BookName.Genesis),
Expand All @@ -29,7 +27,7 @@ const targumLinks = {
};

const rashiVersion: RashiVersionOptions = 'Rashi Chumash, Metsudah Publications, 2009';
const baseRashiLink = `https://raw.githubusercontent.com/Sefaria/Sefaria-Export/master/json/Tanakh/Commentary/Rashi/Torah/Rashi%20on%20$book/Hebrew/${rashiVersion}.json`;
const baseRashiLink = `https://raw.githubusercontent.com/Sefaria/Sefaria-Export/master/json/Tanakh/Commentary/Rashi/Torah/Rashi on $book/Hebrew/${rashiVersion}.json`;
const getRashiLink = (book: BookName) => encodeURI(baseRashiLink.replace('$book', book));
const rashiLinks = {
[BookName.Genesis]: getRashiLink(BookName.Genesis),
Expand Down

0 comments on commit 876eb2d

Please sign in to comment.