justinwalsh / daux.io

Daux.io is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.
daux.io
4.54k stars 526 forks source link

problems with page jump links, like in TOC, and special chars #461

Closed dkern closed 7 years ago

dkern commented 7 years ago

I've notices some problems with page jump links and special chars. For example, having a headline like this:

# TEST : Test

Will generate an h1 element like this:

<h1 id="page_TEST+%3A+Test">TEST : Test</h1>

So the link, genereated by TOC is also escape the : chart to %A3:

#page_TEST+%3A+Test

But such jump links don't work with special char escaping. It should be used a generation like GitHub uses it. So the above example would result in #test-test, all lower case and separated by -, specialchars will be ignored completly.

onigoetz commented 7 years ago

Hello, I fixed this in the master branch, I didn't notice the escaped strings actually didn't work as URLS.

So I applied the escaping like you proposed, and I also added a uniqueness check in case two headings are identical