Open karasugawasu opened 1 year ago
I'm also experiencing this bug on version 0.18.2. (example comment).
Interestingly, the internal footnote anchor IDs work as expected if you load the page from scratch (click me). The issue only seems to happen when browsing at a comment permalink and then clicking a footnote hyperlink -- doing this causes the browser to navigate to the expected URL w/ anchor but fails to actually scroll to the anchor.
I couldn't fix it myself, so I temporarily added code to the custom html header to take care of it. I'll put it here for your reference.
LEMMY_UI_CUSTOM_HTML_HEADER: >
<script>
window.addEventListener('click', e => {
const link = e.target.getAttribute('href');
if (/^#/.test(link)) {
e.preventDefault();
escapeLink = "#" + CSS.escape(link.slice(1))
const toTarget = document.querySelector(escapeLink);
if (toTarget) {
if (toTarget.scrollIntoView) {
toTarget.scrollIntoView({ behavior: "smooth", block: "start", inline: "nearest" });
} else {
let rect = toTarget.getBoundingClientRect();
window.scrollTo(rect.x, rect.y)
}
}
}
});
</script>
Requirements
Summary
Footnotes do not work in Markdown from 0.18.0.
The HTML is correct, but clicking on the link only reloads the page and does not take you to the footnote of that one.
Steps to Reproduce
Technical Details
Windows11、Chrome 114.0.5735.134
Lemmy Instance Version
0.18.0
Lemmy Instance URL
No response