takezoe/gitbucket — pull request #272 by jeffreyolchovy (2014-02-08 19:07:35+00:00)
Title: Fix for #231: Generate headline anchor in Wiki pages

When converting headers from markdown to HTML, insert an empty anchor tag with name and href attributes as the first descendent of the generated header tag. As far as I could tell, this is what GitHub does. The name of the anchor is a normalized version of the header text. I included a few unit tests for generating the anchor name, but it more extensive test cases may be useful (i.e. to see how this routine handles non-Latin character sets).