mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-06-05 23:00:16 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user