More cleaning up.

This commit is contained in:
Caleb Campbell
2025-07-11 15:30:32 +10:00
parent eb6869738c
commit 0f1a971ed7
5 changed files with 9 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
{
"id": "local-bible-ref",
"name": "Local Bible Ref",
"version": "1.0.1",
"version": "1.0.2",
"minAppVersion": "0.15.0",
"description": "Quickly and easily reference Bible passages stored locally in your Obsidian vault.",
"author": "Caleb Campbell",

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "local-bible-ref",
"version": "1.0.1",
"version": "1.0.2",
"lockfileVersion": 3,
"requires": true,
"packages": {

View File

@@ -1,6 +1,6 @@
{
"name": "local-bible-ref",
"version": "1.0.1",
"version": "1.0.2",
"description": "Quickly and easily reference Bible passages stored locally in your Obsidian vault.",
"main": "main.js",
"scripts": {

View File

@@ -175,7 +175,7 @@ export class PassageReference implements ChapterReference, PassageOptions {
// there are special keywords for formatting (m or manuscript, for
// example) - anything else is treated as a Bible version code
for (let option of optionArgs) {
for (const option of optionArgs) {
switch (option) {
case "m":
case "manuscript":

View File

@@ -110,7 +110,7 @@ export class PassageSuggest extends EditorSuggest<PassageSuggestion> {
ref: PassageReference
): Promise<string[] | null> {
let basePath = "";
for (let alias of [ref.book.name, ...ref.book.aliases]) {
for (const alias of [ref.book.name, ...ref.book.aliases]) {
basePath = [this.settings.biblesPath, ref.version, alias].join("/");
// if the book exists at this alias, use the alias instead
@@ -210,14 +210,14 @@ export class PassageSuggest extends EditorSuggest<PassageSuggestion> {
private removeBOF(text: string): string {
if (!text.startsWith("---")) return text;
// split at YAML front matter
let split = text.split(/^\-\-\-$/m);
const split = text.split(/^---$/m);
return split[2].trim();
}
/** Removes the end-of-file content from the given text. */
private removeEOF(text: string): string {
// split at chapter divider
let split = text.split(/^\-\-\-$/m);
let split = text.split(/^---$/m);
// split at footnotes
split = split[0].split(/^\[\^\d+\]:/m, 1);
return split[0].trim();
@@ -262,7 +262,7 @@ export class PassageSuggest extends EditorSuggest<PassageSuggestion> {
formatted = formatted.replace(/\n/gm, "\n> ");
formatted += "\n\n";
break;
case PassageFormat.Callout:
case PassageFormat.Callout: {
const passageReference = passageRef.stringify();
const passageLink = this.generatePassageLink(passageRef, context);
formatted = `> [!quote] [${passageReference}](${passageLink})\n`;
@@ -271,6 +271,7 @@ export class PassageSuggest extends EditorSuggest<PassageSuggestion> {
formatted += "\n\n";
break;
}
}
return formatted;
}