newline_to_br替换换行符

newline_to_br替换换行符

ZKEASOFT April 18, 2021


将换行符(\n)替换为HTML的<br/>:

{% capture string_with_newlines %}
Hello
there
{% endcapture %}

{{ string_with_newlines | newline_to_br }}

输出:

<br />
Hello<br />
there<br />

微信公众号