3 * @copyright Copyright (c) 2014 Carsten Brandt
4 * @license https://github.com/cebe/markdown/blob/master/LICENSE
5 * @link https://github.com/cebe/markdown#readme
8 namespace cebe\markdown\tests;
10 use cebe\markdown\GithubMarkdown;
13 * Test case for the github flavored markdown.
15 * @author Carsten Brandt <mail@cebe.cc>
18 class GithubMarkdownTest extends BaseMarkdownTest
20 public function createMarkdown()
22 return new GithubMarkdown();
25 public function getDataPaths()
28 'markdown-data' => __DIR__ . '/markdown-data',
29 'github-data' => __DIR__ . '/github-data',
33 public function testNewlines()
35 $markdown = $this->createMarkdown();
36 $this->assertEquals("This is text<br />\nnewline\nnewline.", $markdown->parseParagraph("This is text \nnewline\nnewline."));
37 $markdown->enableNewlines = true;
38 $this->assertEquals("This is text<br />\nnewline<br />\nnewline.", $markdown->parseParagraph("This is text \nnewline\nnewline."));
40 $this->assertEquals("<p>This is text</p>\n<p>newline<br />\nnewline.</p>\n", $markdown->parse("This is text\n\nnewline\nnewline."));
43 public function dataFiles()
45 $files = parent::dataFiles();
46 foreach($files as $i => $f) {
47 // skip files that are different in github MD
48 if ($f[0] === 'markdown-data' && (
49 $f[1] === 'list-marker-in-paragraph' ||
50 $f[1] === 'dense-block-markers'