Do not interpolate verses if args are set.
This commit is contained in:
parent
0f87e8a08d
commit
5d05d4011e
1 changed files with 6 additions and 3 deletions
|
|
@ -9,9 +9,13 @@ function scriptureLink(node, args, meta) {
|
|||
if (value.match(/[Vv][Vv]?(erses?)?\s*/)) {
|
||||
const book = meta.data.astro.frontmatter.book;
|
||||
const chapter = meta.data.astro.frontmatter.chapter;
|
||||
passage = `${book} ${chapter}:${value.replace(/[Vv][Vv]?(erses?)?\s*/, '')}`;
|
||||
if ((args.length == 0 || args[0] == '') && (book && chapter)) {
|
||||
passage = `${book} ${chapter}:${value.replace(/[Vv][Vv]?(erses?)?\s*/, '')}`;
|
||||
} else if (args.length == 0 || args[0] == '') {
|
||||
node.properties.href = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
console.log("passage with meta:", passage);
|
||||
|
||||
// Stylized hyphen replacement from Logos.
|
||||
passage = passage.replaceAll(/–/g, '-');
|
||||
|
|
@ -30,7 +34,6 @@ function scriptureLink(node, args, meta) {
|
|||
if (passage !== '') {
|
||||
node.properties.href = `https://www.biblegateway.com/passage/?search=${passage}&version=ESV`;
|
||||
}
|
||||
console.log('passage after:', passage);
|
||||
|
||||
if (match) {
|
||||
currentBook = match?.[1].trim();
|
||||
|
|
|
|||
Loading…
Reference in a new issue