Conversation
|
Anchor link is a part of toc, full toc feature needs to generate the table of content or provide a method to get the toc. |
Yes, this is one of feature of toc, but i thought it's optional. But, i consider |
|
I think this is something best implemented in a custom renderer rather than upstream |
Yes, I use it on my fork, if we make the |
|
I'm not sure. On one hand this is useful; on the other this isn't something specified in the commonmark or gfm specs, which leads me towards it being something implemented by those who want it. How do we feel about out of spec extensions? |
|
I think anchor links for every heading are a very valuable UX feature. However, it's a bit tricky getting the HTML right. The current implementation for example creates an anchor element adjacent to the header element. But they're not directly grouped together, which can make it hard to style properly. <div class="header-wrapper">
<h2 id="title">Title</h2>
<a href="#title">§</a>
</div>Improving accessibility requires some further enhancements to make sense of the anchor link. IMO a decent default implementation could very well fit into upstream. But it should also be easily customizable with custom renderers. So maybe it's best to start with that to make sure it's simple to override the details without changing the overall structure? |
d97572b to
0715608
Compare
|
Maybe we can add a new option instead of |
icyleaf
left a comment
There was a problem hiding this comment.
Missing unit tests, add it pls.
Enable display a link svg when set
Markd::Options.new(toc: true), like following screenshot.