LiquidJS

TutorialsTagsFiltersPlaygroundAPI
Github
Overviewabsappendat_leastat_mostcapitalizeceilcompactconcatdatedate_to_long_stringdate_to_rfc822date_to_stringdate_to_xmlschemadefaultdivided_bydowncaseescapeescape_oncefindfind_expfirstfloorgroup_bygroup_by_expinspectjoinjsonjsonifylastlstripmapminusmodulonewline_to_brnormalize_whitespacepluspoppushprependrawremoveremove_firstremove_lastreplacereplace_firstreplace_lastreverseroundrstripshiftsizeslicesortsort_naturalsplitstripstrip_htmlstrip_newlinessumtimesto_integertruncatetruncatewordsuniqunshiftupcaseurl_decodeurl_encodewherewhere_exp

newline_to_br

v1.9.1

Replaces every newline (\n) in a string with an HTML line break (<br />).

Input

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

{{ string_with_newlines | newline_to_br }}

Output


<br/>Hello<br/>there<br/>
Last updated: 2024-05-09 PrevNext
Contents
Back to Top
© 2024 Harttle
Documentation licensed under CC BY 4.0.
    TutorialsTagsFiltersPlaygroundAPI
Overviewabsappendat_leastat_mostcapitalizeceilcompactconcatdatedate_to_long_stringdate_to_rfc822date_to_stringdate_to_xmlschemadefaultdivided_bydowncaseescapeescape_oncefindfind_expfirstfloorgroup_bygroup_by_expinspectjoinjsonjsonifylastlstripmapminusmodulonewline_to_brnormalize_whitespacepluspoppushprependrawremoveremove_firstremove_lastreplacereplace_firstreplace_lastreverseroundrstripshiftsizeslicesortsort_naturalsplitstripstrip_htmlstrip_newlinessumtimesto_integertruncatetruncatewordsuniqunshiftupcaseurl_decodeurl_encodewherewhere_exp