Open traut opened 3 weeks ago
in addition, #
breaks the anchor:
[Target #1 - 192.168.x.1](#target-#1---192.168.x.1)
We should follow GitHub Markdown schema here and skip #
character
moved to milestone 0.5 to wait for https://github.com/blackstork-io/fabric/issues/159 as it is an enabler for this issue
ToC is rendered with local markdown links. At the moment, the anchors (hash in the URL) are derived from the title, which creates an issue when similar titles are used:
The anchors should be suffixed with
-<number>
if there if there are duplicates, for example:Uniqueness
First iteration
The problem is that we can not be sure that the user's Markdown rendered will de-duplicate links similarly - by adding
-<num>
-- as the Github Markdown renderer does. This is ok for the first iteration.Proper fix
Since generic Markdown schema does not allow custom anchors on titles, another way to enable uniqueness here is to reformat the duplicate titles as HTML tags: instead of
create
This complicates the logic—the ToC plugin would need to reprocess already produced Markdown strings to rewrite the headers. This is a good second iteration
References