2018-03-15 13:42:29 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class UnsafeExtension extends Parsedown
|
|
|
|
{
|
|
|
|
protected function blockFencedCodeComplete($Block)
|
|
|
|
{
|
|
|
|
$text = $Block['element']['text']['text'];
|
|
|
|
unset($Block['element']['text']['text']);
|
|
|
|
|
2018-03-15 14:00:03 +03:00
|
|
|
// 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).
|
2018-03-15 13:42:29 +03:00
|
|
|
$Block['element']['text']['unsafeHtml'] = "<p>$text</p>";
|
|
|
|
|
|
|
|
return $Block;
|
|
|
|
}
|
|
|
|
}
|