1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Further attempt to dissuade this feature's use

This commit is contained in:
Aidan Woods 2018-03-15 11:00:03 +00:00
parent e6444bb57e
commit e4c5be026d
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -7,6 +7,11 @@ class UnsafeExtension extends Parsedown
$text = $Block['element']['text']['text'];
unset($Block['element']['text']['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']['text']['unsafeHtml'] = "<p>$text</p>";
return $Block;