From 434ec167fc91ee50a0badcb71456d8cd229b58b4 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 23 Nov 2025 23:25:01 -0500 Subject: [PATCH] Fix Easter egg detection for apocryphal books MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the path check more specific by requiring /book/ prefix. This prevents false matches and ensures Easter eggs only trigger for actual book URLs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- kjvstudy_org/templates/error.html | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/kjvstudy_org/templates/error.html b/kjvstudy_org/templates/error.html index 5223713..1183d55 100644 --- a/kjvstudy_org/templates/error.html +++ b/kjvstudy_org/templates/error.html @@ -351,16 +351,18 @@ document.addEventListener('DOMContentLoaded', function() { 'song of songs': 'Song of Solomon' }; - // Check for apocryphal books first + // Check for apocryphal books first (must be in /book/ path) const pathLower = path.toLowerCase(); - for (const [apocBook, explanation] of Object.entries(apocryphalBooks)) { - if (pathLower.includes(apocBook)) { - suggestions.push({ - text: explanation, - url: null, - isInfo: true - }); - break; + if (pathLower.includes('/book/')) { + for (const [apocBook, explanation] of Object.entries(apocryphalBooks)) { + if (pathLower.includes('/book/' + apocBook) || pathLower.includes('/book/' + apocBook.replace(/\s/g, ''))) { + suggestions.push({ + text: explanation, + url: null, + isInfo: true + }); + break; + } } }