From 2c4afdcd66183e48516f641d608b7dabe23d9d46 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sat, 6 Dec 2025 17:23:16 -0500 Subject: [PATCH] Skip only bold verse text, keep rest of first paragraph MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of skipping the entire first paragraph, now only removes the tag content (which contains the verse text) and reads the remainder of the paragraph. This preserves the commentary context while avoiding duplicate verse reading. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- kjvstudy_org/templates/verse.html | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/kjvstudy_org/templates/verse.html b/kjvstudy_org/templates/verse.html index e6d1a5c..3f0f8e8 100644 --- a/kjvstudy_org/templates/verse.html +++ b/kjvstudy_org/templates/verse.html @@ -1542,18 +1542,28 @@ a.crossref-pill:hover { var verseEl = document.querySelector('.verse-text'); var verseText = verseEl ? verseEl.textContent.trim() : ''; if (verseText) parts.push(verseText); - // Add commentary sections, skipping first paragraph if it contains the verse text + // Add commentary sections, skipping bold verse text in first paragraph var commentaryEls = document.querySelectorAll('.commentary-section p, .commentary-section li'); var isFirst = true; commentaryEls.forEach(function(el) { - var elText = el.textContent.trim(); - // Skip first paragraph if it starts with the verse text (common pattern) - if (isFirst && el.tagName === 'P' && verseText && elText.substring(0, 50).includes(verseText.substring(0, 50))) { + var elText; + // For first paragraph, skip the bold/strong part (usually contains verse text) + if (isFirst && el.tagName === 'P') { + var strong = el.querySelector('strong'); + if (strong && verseText && strong.textContent.trim().substring(0, 40) === verseText.substring(0, 40)) { + // Clone the element and remove the strong tag to get remaining text + var clone = el.cloneNode(true); + var strongInClone = clone.querySelector('strong'); + if (strongInClone) strongInClone.remove(); + elText = clone.textContent.trim(); + } else { + elText = el.textContent.trim(); + } isFirst = false; - return; + } else { + elText = el.textContent.trim(); } - isFirst = false; - parts.push(elText); + if (elText) parts.push(elText); }); var text = parts.join(' '); if (window.KJVSpeech && text) {