filter_escape_link (zotonic_mod_base v1.0.0-rc.17)

Convert any URLs in a plaintext into HTML links, with adding the rel="nofollow" attribute, and replaces all newlines with <br\> tags.

Example:

{{ "Hello http://foo.bar/\n\nAnd bye."|escape_link }}

Outputs:

"Hello <a href="http://foo.bar/" rel="noopener nofollow noreferrer">http://foo.bar/</a><br /><br />And bye."

This filter is very useful when displaying user-generated plaintexts, like comments.

See also

urlize

Summary

Functions

escape_link(Text, Context)