From a83f1cabe6c925ddc253ceb52fb828079e783952 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Shelton" Date: Mon, 29 Jun 2026 22:29:56 -0600 Subject: [PATCH] Match only verse identifies at start of string. --- src/utils/rehype.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/rehype.js b/src/utils/rehype.js index ecd341a..e875ea8 100644 --- a/src/utils/rehype.js +++ b/src/utils/rehype.js @@ -6,11 +6,11 @@ function scriptureLink(node, args, meta) { const value = node.children?.[0]?.value?.trim() || ''; let passage = (args && args.length > 0 && args[0] != '') ? args[0] : value; - if (value.match(/[Vv][Vv]?(erses?)?\s*/)) { + if (value.match(/^[Vv][Vv]?(erses?)?\s*/)) { const book = meta.data.astro.frontmatter.book; const chapter = meta.data.astro.frontmatter.chapter; if ((args.length == 0 || args[0] == '') && (book && chapter)) { - passage = `${book} ${chapter}:${value.replace(/[Vv][Vv]?(erses?)?\s*/, '')}`; + passage = `${book} ${chapter}:${value.replace(/^[Vv][Vv]?(erses?)?\s*/, '')}`; } else if (args.length == 0 || args[0] == '') { node.properties.href = null; return;