Fix Easter egg detection for apocryphal books

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 <noreply@anthropic.com>
This commit is contained in:
2025-11-23 23:25:01 -05:00
parent 2f403f00b4
commit 434ec167fc
+11 -9
View File
@@ -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;
}
}
}