newline_to_br
在字符串中每个换行符 (\n
) 前插入一个 HTML 换行符 (<br />
)。
输入
{% capture string_with_newlines %}
Hello
there
{% endcapture %}
{{ string_with_newlines | newline_to_br }}
输出
<br />
Hello<br />
there<br />
在字符串中每个换行符 (\n
) 前插入一个 HTML 换行符 (<br />
)。
输入
{% capture string_with_newlines %}
Hello
there
{% endcapture %}
{{ string_with_newlines | newline_to_br }}
输出
<br />
Hello<br />
there<br />