1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Compare commits

...

3 Commits
0.5.0 ... 0.6.0

3 changed files with 27 additions and 34 deletions

View File

@ -5,7 +5,3 @@ php:
- 5.4 - 5.4
- 5.3 - 5.3
- 5.2 - 5.2
matrix:
allow_failures:
- php: 5.2

View File

@ -238,20 +238,11 @@ class Parsedown
break; break;
} }
# ~
if ($line[0] >= 'a' and $line[0] !== '~' or $line[0] >= 'A' and $line[0] <= 'Z')
{
goto paragraph;
}
# ~
$deindented_line = $line;
# #
# indentation sensitive types # indentation sensitive types
$deindented_line = $line;
switch ($line[0]) switch ($line[0])
{ {
case ' ': case ' ':
@ -500,9 +491,7 @@ class Parsedown
continue; continue;
} }
# ~ # paragraph
paragraph:
if ($element['type'] === 'p') if ($element['type'] === 'p')
{ {

View File

@ -20,20 +20,29 @@ class Test extends PHPUnit_Framework_TestCase
{ {
$provider = array(); $provider = array();
$DirectoryIterator = new DirectoryIterator(__DIR__ . '/' . self::provider_dir); $path = dirname(__FILE__).'/';
$DirectoryIterator = new DirectoryIterator($path . '/' . self::provider_dir);
foreach ($DirectoryIterator as $Item) foreach ($DirectoryIterator as $Item)
{ {
if ($Item->isFile() and $Item->getExtension() === 'md') if ($Item->isFile())
{ {
$filename = $Item->getFilename();
$extension = pathinfo($filename, PATHINFO_EXTENSION);
if ($extension !== 'md')
continue;
$basename = $Item->getBasename('.md'); $basename = $Item->getBasename('.md');
$markdown = file_get_contents(__DIR__ . '/' . self::provider_dir . $basename . '.md'); $markdown = file_get_contents($path . '/' . self::provider_dir . $basename . '.md');
if (!$markdown) if (!$markdown)
continue; continue;
$expected_markup = file_get_contents(__DIR__ . '/' . self::provider_dir . $basename . '.html'); $expected_markup = file_get_contents($path . '/' . self::provider_dir . $basename . '.html');
$expected_markup = str_replace("\r\n", "\n", $expected_markup); $expected_markup = str_replace("\r\n", "\n", $expected_markup);
$expected_markup = str_replace("\r", "\n", $expected_markup); $expected_markup = str_replace("\r", "\n", $expected_markup);
@ -44,4 +53,3 @@ class Test extends PHPUnit_Framework_TestCase
return $provider; return $provider;
} }
} }