public function test_tidy() { $bbcode = new BBCode(); $document = $bbcode->toDocument("[b]Hello [p]big [/p] [p]awesome[/] world[/b]"); $tidy = new Tidy(); $tidy->addBlockTag("p"); $tidy->tidy($document); $renderContext = RenderContext::create(); $tidied = $renderContext->render($document); $this->assertEquals("[b]Hello [/b][p][b]big [/b][/p][b] [p]awesome[/] world[/b]", $tidied); }
public function __construct() { $this->renderContext = RenderContext::create(); $this->parser = new Parser(); $this->initDefaultDecorators(); }