hoedown/hoedown — pull request #94 by uranusjr (2014-08-07 06:03:31+00:00)
Title: Add hooks and fields to support custom rendering

Since there are so many Markdown variants with custom syntaxes, maybe it would be better to give the user the ability to add extra rules to the parser/renderer.

What I currently have in mind is:

1. Add a function pointer member in `hoedown_document` and a `void *` data pointer for custom data.
2. Add helper functions to expose the function pointer and data field, and for setting special characters (`active_char`).
3. Add a function pointer in `hoedown_renderer`.
4. Call the `parse_custom` function in `parse_block`.

The user can do whatever he/she wants in the custom parsing function, including calling the rendering function. The rendering function includes a `data` argument if additional configs are required. If state is needed, the user can put whatever needed in the `data` field of the `hoedown_document` struct, too.

The PR is not expected to be merged as-is, I’m only including it to show how the idea is implemented, so that I can hear what you guys think.