. */ /** * Nl2Br filter. * * This filter converts line breaks to HTML <br /> tags. * * @since 4.6.0 * @package Textfilter */ namespace Textpattern\Textfilter; class Nl2Br extends Base implements TextfilterInterface { /** * Constructor. */ public function __construct() { parent::__construct(CONVERT_LINEBREAKS, gTxt('convert_linebreaks')); } /** * Filter. * * @param string $thing * @param array $options */ public function filter($thing, $options) { parent::filter($thing, $options); return nl2br(trim($thing)); } }