0
votes

Is there a way to set Modx Revolution to output HTML <br>s using the :nlb2r output filter rather than XHTML <br />s through a system setting?

3
Why would I duplicate my own question? That's just dumb.Brandon Lebedev

3 Answers

0
votes

Just create custom snippet - http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+%28Output+Modifiers%29 , as example:

<?php
$mode = !empty($options) ? true : false;
return nl2br($input, $mode);

This filter does not depend on the system settings, he is located in the code modx- https://github.com/modxcms/revolution/blob/develop/core/model/modx/filters/modoutputfilter.class.php#L431 so you need to create custom snippet.

0
votes

Output filters are hard coded.

You could always:

SomeElement:nl2br:replace=`<br />==<br>`

Not really sure you want to drop the / as HTML5 simply ignores it. But any case, replace will serve you well.

Check out chapter 7 of my book, it has all of the filters and examples on how to chain them.

-1
votes

You should avoid using snippets and filters are much as you can. They increase the parsing-time.

There's a setting for what you ask

Search for tiny.element_format and change it to html.