mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-06-05 23:00:16 +00:00
Add chapter-only reference linking in study guides
Links like "Psalm 2" and "Psalm 45" now link to chapter pages. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -100,6 +100,13 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
}
|
||||
});
|
||||
|
||||
// Handle chapter-only references like "Psalm 2" or "Genesis 1"
|
||||
// Must come after verse references to avoid double-matching
|
||||
text = text.replace(/\b(Psalm|Genesis|Exodus|Isaiah|Daniel|Revelation|Matthew|Mark|Luke|John|Romans|Hebrews|Proverbs|Ecclesiastes|Job)\s+(\d+)\b(?!:)/g, function(match, book, chapter) {
|
||||
changed = true;
|
||||
return '<a href="/book/' + book + '/chapter/' + chapter + '">' + match + '</a>';
|
||||
});
|
||||
|
||||
if (changed) {
|
||||
const span = document.createElement('span');
|
||||
span.innerHTML = text;
|
||||
|
||||
Reference in New Issue
Block a user