diff --git a/src/utils/handle-content-links.js b/src/utils/handle-content-links.js index 153cae15..792dbf3e 100644 --- a/src/utils/handle-content-links.js +++ b/src/utils/handle-content-links.js @@ -45,7 +45,9 @@ function handleContentLinks(opts) { } else if (states.unfurledLinks[target.href]?.url) { e.preventDefault(); e.stopPropagation(); - states.prevLocation = location; + states.prevLocation = { + pathname: location.hash.replace(/^#/, ''), + }; location.hash = `#${states.unfurledLinks[target.href].url}`; } };