Skip to content

Commit

Permalink
Further attempt to dissuade this feature's use
Browse files Browse the repository at this point in the history
  • Loading branch information
aidantwoods committed Mar 15, 2018
1 parent e6444bb commit e4c5be0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/UnsafeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ protected function blockFencedCodeComplete($Block)
$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;
Expand Down

0 comments on commit e4c5be0

Please sign in to comment.