Make it possible to link to page fragments

Fixes #543
This commit is contained in:
Asai Toshiya
2025-03-15 05:11:57 +09:00
parent 4f8b441a5d
commit a9910a8ec9

View File

@@ -200,7 +200,14 @@ document.addEventListener('DOMContentLoaded', () => {
// If everything is working, proceed with main functionality
parseAndDisplayContent()
.then(() => console.log('Content successfully parsed and displayed'))
.then(() => {
console.log("Content successfully parsed and displayed");
// Show section if page fragment exists
if (location.hash) {
document.querySelector(`a[href='${location.hash}']`).click();
}
})
.catch(error => {
console.error('Error in main content processing:', error);
document.getElementById('resources-container').innerHTML = `