Skip to content

Commit

Permalink
Update usage (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
baijunyao authored May 30, 2022
1 parent 01c737c commit f3b5a65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Here you can see an example of just how simple this package is to use.
```php
use GrahamCampbell\Markdown\Facades\Markdown;

Markdown::convertToHtml('foo'); // <p>foo</p>
Markdown::convert('foo')->getContent(); // <p>foo</p>
```

If you prefer to use dependency injection over facades like me, then you can easily inject the class like so:
Expand Down
6 changes: 3 additions & 3 deletions tests/Facades/MarkdownTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function getFacadeRoot()

public function testConvertToHtml()
{
$result = Markdown::convertToHtml('foo');
$result = Markdown::convert('foo');

$this->assertSame("<p>foo</p>\n", $result->getContent());
}
Expand All @@ -69,7 +69,7 @@ public function testDisallowingUnsafeLinks()
{
$this->app->config->set('markdown.allow_unsafe_links', false);

$result = Markdown::convertToHtml("[Click me](javascript:alert('XSS'))");
$result = Markdown::convert("[Click me](javascript:alert('XSS'))");

$this->assertSame("<p><a>Click me</a></p>\n", $result->getContent());
}
Expand All @@ -82,7 +82,7 @@ public function testSmartPuncConversion()
SmartPunctExtension::class,
]);

$result = Markdown::convertToHtml("'A', 'B', and 'C' are letters.");
$result = Markdown::convert("'A', 'B', and 'C' are letters.");

$this->assertSame("<p>‘A’, ‘B’, and ‘C’ are letters.</p>\n", $result->getContent());
}
Expand Down

0 comments on commit f3b5a65

Please sign in to comment.