示例#1
0
 /**
  * @dataProvider commonMarkSpecRegressions
  */
 public function testSpecRegressions($source, $expected)
 {
     $parser = new \FluxBB\CommonMark\DocumentParser();
     $renderer = new \FluxBB\CommonMark\Renderer();
     $tree = $parser->convert($source);
     $actual = $renderer->render($tree);
     $this->assertEquals($expected, $actual);
 }
示例#2
0
    /**
     * @expectedException FluxBB\CommonMark\Exception\SyntaxError
     * @expectedExceptionMessage [link] Unable to find id "id" in Reference-style link at line 3
     */
    public function testSyntaxErrorPointsRightLineNumber()
    {
        $parser = new \FluxBB\CommonMark\DocumentParser();
        $markdown = <<<EOL
This is a paragraph

This is a [paragraph][id].

<pre>
preformatted text
</pre>
EOL;
        $parser->convert($markdown);
    }