the <%block> tag was made for this sort of thing:
from mako.template import Template
t = Template("""
<%block filter="wrap">
alsfalskmf alsdkfm aslkf asdlkf aslkfmaslfma ds skjfna ksjfn adkjfn adskjfn
</%block>
""")
import textwrap
def wrap(text):
return "\n".join(textwrap.wrap(text, 40)).strip()
print t.render(wrap = wrap)
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups "Mako Templates for Python" group.
> To post to this group, send email to mako-d...@googlegroups.com.
> To unsubscribe from this group, send email to mako-discuss...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mako-discuss?hl=en.
>