예제 #1
0
 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);
 }
예제 #2
0
파일: BBCode.php 프로젝트: devristo/bbcode
 public function __construct()
 {
     $this->renderContext = RenderContext::create();
     $this->parser = new Parser();
     $this->initDefaultDecorators();
 }