markdown-it / markdown-it-footnote

Footnotes plugin for markdown-it markdown parser
https://markdown-it.github.io/
MIT License
212 stars 59 forks source link

highlighting of footnote-items when clicking on footnote-ref #24

Closed simonsilabs closed 6 years ago

simonsilabs commented 6 years ago

When clicking on footnote-reference, the corresponging footnote is not highlighted. While the other way around, clicking on the back-reference, to footnote-reference in the text is nicely highlighted and stylable with CSS :focus…

The Reason seems to be, that :focus only works on interactive elements like links or inputs.. So I wonder if there's a way to make it work?

As far as I know elements can get focused if they have a tabindex, so that could be a solution.

Or the id of the footnote as part of a separate (pseudo-)interactive element, like an <a> without href:

<li class="footnote-item">
  <a id="fn1">FN:</a>
  <p>footnote content</p>
</li>

(While 'FN:' could also be a icon like ― or •)

puzrin commented 6 years ago

Sorry, i'm not frontend developper and can't consult about css. The only thing i can say - you can modify generated markup as you wish, if you don't like default one.