choco-wiki icon indicating copy to clipboard operation
choco-wiki copied to clipboard

TOC links broken if heading contains slash (only on website)

Open znegva opened this issue 7 years ago • 3 comments

Most Pages contain a table of content (TOC) with links to the subitems of the page. If the subitem contains a slash / the link to this subitem is broken on the website (https://chocolatey.org/docs/).

Example https://chocolatey.org/docs/security

Security.md has a subitem named Servers / IP Addresses.
On Line 16 the TOC-link to this subitem is defined as:

- [Servers / IP Addresses](#servers--ip-addresses)

This is working for github and github-wiki markdown-preview/rendering, here a heading of foo / bar gets a generated id/anchor-tag of foo--bar.
But on the website a foo / bar heading gets an id/anchor-tag of foo-bar (only one minus).

There seems to be a little difference in auto-generating the anchor-tags of headings on the website which should be adjusted to the method that github is using.


Note: e.g. in Troubleshooting.md anchors that match the github-style had beed added by hand above the subitems-headings. Not sure if this is the preferred way to handle this.

znegva avatar Feb 15 '18 00:02 znegva

Note: e.g. in Troubleshooting.md anchors that match the github-style had beed added by hand above the subitems-headings. Not sure if this is the preferred way to handle this.

That's not by hand ;) We use a TOC generator with Visual Studio code. That's why you see this: <!-- TOC insertAnchor:true --> in the file

ferventcoder avatar Feb 15 '18 22:02 ferventcoder

@znegva thanks for the feedback - we use pandoc and some other bits to convert from markdown to cshtml, but we are looking at going to markdig instead. 👍 I would imagine it will fix this issue.

ferventcoder avatar Feb 15 '18 22:02 ferventcoder

The Home.md has a similar issue on the Wiki and Chocolatey.org for the link 'Walkthroughs / How To Links'.

Just an FYI.

pauby avatar Jan 08 '19 16:01 pauby