mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Use ->toHtml over ->text
This commit is contained in:
parent
a2ea704a43
commit
a72455c78a
@ -35,13 +35,13 @@ final class Parsedown
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $text
|
||||
* @param string $markdown
|
||||
* @return string
|
||||
*/
|
||||
public function text($text)
|
||||
public function toHtml($markdown)
|
||||
{
|
||||
list($StateRenderables, $State) = self::lines(
|
||||
Lines::fromTextLines($text, 0),
|
||||
Lines::fromTextLines($markdown, 0),
|
||||
$this->State
|
||||
);
|
||||
|
||||
|
@ -50,7 +50,7 @@ class CommonMarkTestStrict extends TestCase
|
||||
*/
|
||||
public function testExample($_, $__, $markdown, $expectedHtml)
|
||||
{
|
||||
$actualHtml = $this->Parsedown->text($markdown);
|
||||
$actualHtml = $this->Parsedown->toHtml($markdown);
|
||||
$this->assertEquals($expectedHtml, $actualHtml);
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ class CommonMarkTestWeak extends CommonMarkTestStrict
|
||||
{
|
||||
$expectedHtml = $this->cleanupHtml($expectedHtml);
|
||||
|
||||
$actualHtml = $this->Parsedown->text($markdown);
|
||||
$actualHtml = $this->Parsedown->toHtml($markdown);
|
||||
$actualHtml = $this->cleanupHtml($actualHtml);
|
||||
|
||||
$this->assertEquals($expectedHtml, $actualHtml);
|
||||
|
@ -61,7 +61,7 @@ class ParsedownTest extends TestCase
|
||||
new Breaks(\substr($test, 0, 14) === 'breaks_enabled'),
|
||||
]));
|
||||
|
||||
$actualMarkup = $Parsedown->text($markdown);
|
||||
$actualMarkup = $Parsedown->toHtml($markdown);
|
||||
|
||||
$this->assertEquals($expectedMarkup, $actualMarkup);
|
||||
}
|
||||
@ -154,6 +154,6 @@ EXPECTED_HTML;
|
||||
InlineTypes::initial()->removing([InlineMarkup::class]),
|
||||
]));
|
||||
|
||||
$this->assertEquals($expectedHtml, $parsedownWithNoMarkup->text($markdownWithHtml));
|
||||
$this->assertEquals($expectedHtml, $parsedownWithNoMarkup->toHtml($markdownWithHtml));
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ final class RecursionLimiterTest extends TestCase
|
||||
. '<p>foo</p>'
|
||||
. \str_repeat("\n</blockquote>", 3)
|
||||
),
|
||||
$Parsedown->text($borderline)
|
||||
$Parsedown->toHtml($borderline)
|
||||
);
|
||||
|
||||
$this->assertSame(
|
||||
@ -39,7 +39,7 @@ final class RecursionLimiterTest extends TestCase
|
||||
. '<p>> foo</p>'
|
||||
. \str_repeat("\n</blockquote>", 3)
|
||||
),
|
||||
$Parsedown->text($exceeded)
|
||||
$Parsedown->toHtml($exceeded)
|
||||
);
|
||||
|
||||
$this->assertSame(
|
||||
@ -48,7 +48,7 @@ final class RecursionLimiterTest extends TestCase
|
||||
. '<p>fo*o*</p>'
|
||||
. \str_repeat("\n</blockquote>", 3)
|
||||
),
|
||||
$Parsedown->text($exceededByInline)
|
||||
$Parsedown->toHtml($exceededByInline)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user