public function TwigTestExtension::nl2br

nl2br only, for testing filters with pre_escape

1 call to TwigTestExtension::nl2br()
TwigTestExtension::escape_and_nl2br in drupal/core/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php
nl2br which also escapes, for testing escaper filters

File

drupal/core/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php, line 181

Class

TwigTestExtension

Code

public function nl2br($value, $sep = '<br />') {

  // not secure if $value contains html tags (not only entities)
  // don't use
  return str_replace("\n", "{$sep}\n", $value);
}