Remove test extensions

This commit is contained in:
Aidan Woods 2019-01-25 22:28:08 +00:00
parent 11da347aa1
commit 19e21f2d1b
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
2 changed files with 0 additions and 48 deletions

View File

@ -1,25 +0,0 @@
<?php
namespace Erusev\Parsedown\Tests\SampleExtensions;
use Erusev\Parsedown\Tests\TestParsedown;
class TrustDelegatedExtension extends TestParsedown
{
protected function blockFencedCodeComplete($Block)
{
$text = $Block['element']['element']['text'];
unset($Block['element']['element']['text']);
// WARNING: There is almost always a better way of doing things!
//
// This behaviour is NOT needed in the demonstrated case.
// Only use this if you are sure that the result being added into
// rawHtml is safe.
// (e.g. using an external parser with escaping capabilities).
$Block['element']['element']['rawHtml'] = "<p>$text</p>";
$Block['element']['element']['allowRawHtmlInSafeMode'] = true;
return $Block;
}
}

View File

@ -1,23 +0,0 @@
<?php
namespace Erusev\Parsedown\Tests\SampleExtensions;
use Erusev\Parsedown\Tests\TestParsedown;
class UnsafeExtension extends TestParsedown
{
protected function blockFencedCodeComplete($Block)
{
$text = $Block['element']['element']['text'];
unset($Block['element']['element']['text']);
// WARNING: There is almost always a better way of doing things!
//
// This example is one of them, unsafe behaviour is NOT needed here.
// Only use this if you trust the input and have no idea what
// the output HTML will look like (e.g. using an external parser).
$Block['element']['element']['rawHtml'] = "<p>$text</p>";
return $Block;
}
}