Closed abbasou closed 3 months ago
So in poking around a bit, I came across the following snippet:
var BibleAPIDotComProvider = class extends BaseBibleAPIProvider {
constructor(bibleVersion) {
super(bibleVersion);
}
/**
* Build Request Url for Bible-Api.com
* @param bookName
* @param chapter
* @param verses
* @param versionName
*/
buildRequestURL(bookName, chapter, verses, versionName) {
let queryString = `${bookName}+${chapter}:`.replace(/ /g, "+");
queryString += this.convertVersesToQueryString(verses);
this._currentQueryUrl = `${this._apiUrl}/${queryString}?translation=${versionName ? versionName : (this == null ? void 0 : this.BibleVersionKey) ? this.BibleVersionKey : ""}`;
this.bibleGatewayUrl = this.buildBibleGatewayUrl(bookName, chapter, verses);
return this._currentQueryUrl;
}
and noticed the .replace
function. I moved it down toward the end of the function as so:
this.bibleGatewayUrl = this.buildBibleGatewayUrl(bookName, chapter, verses).replace(/ /g, "+");
and restarted Obsidian and lo and behold it worked!
Fix in https://github.com/tim-hub/obsidian-bible-reference/releases/tag/2.4.5
Thanks @abbasou
Describe the bug When using a version from BibleGateway and the Book Name contains a
space
(i.e. "1 Timothy," "2 Chronicles," etc.) the link to BibleGateway will be broken. This will cause formatting issues as well.To Reproduce Steps to reproduce the behavior:
space
in the name.Expected behavior The linker should replace the
space
with a "+" for a proper hyperlink and correct formatting.Screenshots
![image](https://github.com/tim-hub/obsidian-bible-reference/assets/68356554/fdd0b3f1-7afa-4f7c-93c7-2fa02f25c865)
What Device Do You Use(please complete the following information):