thephpleague/commonmark — pull request #18 by colinodell (2014-12-16 02:25:04+00:00)
Title: Refactor to reduce coupling and complexity

Some points of interest:

* Each directive now has it's own:
* Parser (goodbye ugly switch statements!)
* Unique class representing it in the AST
* AST to HTML renderer
* Directive parsers and renderers are registered in the `Environment` class
* `Environment::createCommonMarkEnvironment()` pre-registers everything you need for CommonMark compliance.
* Custom directives can be added using the exact methods we use internally
* The block and inline engines use context classes to maintain their state
* Inline parsing uses a separate `Cursor` class to advance through the current text