From a72455c78a2ef812dfdf774f7ebaa58041d87309 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Sun, 19 Jan 2020 15:26:48 +0000 Subject: [PATCH] Use ->toHtml over ->text --- src/Parsedown.php | 6 +++--- tests/CommonMarkTestStrict.php | 2 +- tests/CommonMarkTestWeak.php | 2 +- tests/ParsedownTest.php | 4 ++-- tests/src/Configurables/RecursionLimiterTest.php | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Parsedown.php b/src/Parsedown.php index ffb79e5..17b0f28 100644 --- a/src/Parsedown.php +++ b/src/Parsedown.php @@ -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 ); diff --git a/tests/CommonMarkTestStrict.php b/tests/CommonMarkTestStrict.php index 13cace0..dd64c21 100644 --- a/tests/CommonMarkTestStrict.php +++ b/tests/CommonMarkTestStrict.php @@ -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); } diff --git a/tests/CommonMarkTestWeak.php b/tests/CommonMarkTestWeak.php index c4dc857..e04ad3c 100644 --- a/tests/CommonMarkTestWeak.php +++ b/tests/CommonMarkTestWeak.php @@ -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); diff --git a/tests/ParsedownTest.php b/tests/ParsedownTest.php index 07b88af..d463279 100755 --- a/tests/ParsedownTest.php +++ b/tests/ParsedownTest.php @@ -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)); } } diff --git a/tests/src/Configurables/RecursionLimiterTest.php b/tests/src/Configurables/RecursionLimiterTest.php index 33e8554..74cbbf3 100644 --- a/tests/src/Configurables/RecursionLimiterTest.php +++ b/tests/src/Configurables/RecursionLimiterTest.php @@ -30,7 +30,7 @@ final class RecursionLimiterTest extends TestCase . '

foo

' . \str_repeat("\n", 3) ), - $Parsedown->text($borderline) + $Parsedown->toHtml($borderline) ); $this->assertSame( @@ -39,7 +39,7 @@ final class RecursionLimiterTest extends TestCase . '

> foo

' . \str_repeat("\n", 3) ), - $Parsedown->text($exceeded) + $Parsedown->toHtml($exceeded) ); $this->assertSame( @@ -48,7 +48,7 @@ final class RecursionLimiterTest extends TestCase . '

fo*o*

' . \str_repeat("\n", 3) ), - $Parsedown->text($exceededByInline) + $Parsedown->toHtml($exceededByInline) ); } }