benmills/robotskirt — pull request #11 by jmendeth (2012-05-04 14:04:50+00:00)
Title: Improvements, extensions and some fixes

Great work with Robotskirt, let's make it more complete!
**Note:** please, re-run the benchmark.

## New features

1. A class named `Renderer` has been created which wraps a `mkd_renderer`.
2. Another class `HtmlRenderer` (which inherits from the above) wraps the standard (X)HTML renderer bundled with Sundown.
3. The render functions (`toHtml` and `toHtmlSync`) now require a `Renderer` as first argument.
Thus, they've been renamed to `markdown` and `markdownSync`.
4. The functions now check the _types_ of their arguments (prevents crashes when passing `null`).
5. The extension flags have been exposed as module properties:
`EXT_AUTOLINK`
`EXT_FENCED_CODE`
`EXT_LAX_HTML_BLOCKS`
`EXT_TABLES`
`EXT_NO_INTRA_EMPHASIS`
`EXT_SPACE_HEADERS`
`EXT_STRIKETHROUGH`
6. The renderer functions now accept extension flags as the (optional) last argument.

## Other optimizations

- Use the `NODE_MODULE` macro.
- The output buffer is directly converted to a JS `Buffer` instead of copying its contents.
- Use RAII to make sure the `mkd_renderer` is always deleted, no matter what happens.

- Those improvements break compatibility, so bumping version to `1.2.2`.
- Keep documentation & examples up-to-date.
- Extend / document new features on README