martenframework / marten

The pragmatic web framework.
https://martenframework.com
MIT License
424 stars 24 forks source link

Add support for linebreaks template filter #64

Closed ellmetha closed 1 year ago

ellmetha commented 1 year ago

Description

Marten's templating system should provide a convenient linebreaks template filter allowing to replace all newlines in a text to HTML line breaks (<br />).

For example, consider the following snippet:

{{ value | linebreaks }}

If value is Hello\nWorld, then the output of the rendered snippet would be Hello<br />World.

ellmetha commented 1 year ago

Added in bff795f!