I want convert \n to <br/> by self-defined filter:
<%
def brescape(text):
return text.replace("\n", "<br/>")
%>
but I was puzzled with the following statement:
${"abc\ndef" | h, brescap}
what i expect:
when the h filter applied, the output should be abc\ndef.
and the output should be abc<br/>def when the second filter brescape applied.
unexpected output:
Is there some who can tell me what happened?