russross/blackfriday — pull request #129 by halostatue (2014-11-24 01:47:02+00:00)
Title: Allow configurable header ID prefix/suffixes.

This is specifically driven by the Hugo usecase where multiple documents are often rendered into the same ultimate HTML page.

When a header ID is written to the output HTML format (either through `HTML_TOC`, `EXTENSION_HEADER_IDS`, or `EXTENSION_AUTO_HEADER_IDS`), it is possible that multiple documents will hvae identical header IDs. To permit validation to pass, it is useful to have a per-document prefix or suffix (in our case, an MD5 of the content filename, and we will be using it as a suffix).

That is, two documents (`A` and `B`) that have the same header ID (`# Reason {#reason}`), will end up having an actual header ID of the form `#reason-DOCID` (e.g., `#reason-A`, `#reason-B`) with these HTML parameters.

This is built on top of #126 (more intelligent collision detection for `EXTENSION_AUTO_HEADER_IDS`).