gollum/gollum-lib — pull request #87 by penguinpowernz (2014-07-12 13:50:47+00:00)
Title: Add ancestry to TOC anchors

This is to with issue gollum#678.

Refactored the TOC filter a bit, broke the `process` method out into 3 other methods:

* `generate_anchor_name`
* `add_anchor_to_header`
* `add_entry_to_toc`

Normalized the anchor names. Allowed only words, digits and non-english characters. Any non conforming character is replaced with a single dash; `-`.

Got the ancestor names generating like so:

```
# Summary
## Horse
# Summary
## Horse
```

Will generate:

```html

TOC

Summary

Horse

Summary

Horse

```

I think it's good. Tests are passing locally.