()
| 427 | // --- Hash routing --------------------------------------------- |
| 428 | |
| 429 | function noteFromHash() { |
| 430 | const hash = window.location.hash.slice(1); // strip leading # |
| 431 | if (!hash) return null; |
| 432 | // Try exact id match first, then slug/title match |
| 433 | return ( |
| 434 | NOTES.find((n) => n.id === hash) || |
| 435 | NOTES.find((n) => n.wikiName.toLowerCase() === hash.toLowerCase()) || |
| 436 | NOTES.find((n) => n.title.toLowerCase().replace(/\s+/g, "-") === hash.toLowerCase()) |
| 437 | ); |
| 438 | } |
| 439 | |
| 440 | function initHashRouting() { |
| 441 | // On back/forward navigation update the loaded note |
no outgoing calls
no test coverage detected