How do I use anchor links within a README without them reloading the page?
mattblack-twc opened this issue · comments
mattblack-twc commented
I have a reference/anchor pair that looks like this:
Metrics
When I click on the link in the rendered markdown, the page reloads and I'm taken from my local url for the story (/?path=/story/documenation-contexts--metrics) to a local url for the iframe (/iframe.html?id=documenation-contexts--metrics#metrics).
Is there a way to do anchors so that the page doesn't reload?
Valerii Sorokobatko commented
@mattblack-twc it is possible in this way
<h2 id="metrics">Metrics</h2>
<a href="#metrics" target="_self">Metrics</a>
mattblack-twc commented
That should have been a super obvious solution and it didn't even occur to me! thank you @tuchk4 !