If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!


  • 0
    kbochert  14 years ago
    To leave both pre blocks and script blocks untouched Try: def save_block(match): s = match.group() if s.startswith('<'): return s return '\n' def filter(d): if not isinstance(d,dict): d = d() cpat = re.compile(r'\n([ \t]+\n)+|(?s)
    .*
    |(?s)') return cpat.sub(save_block, response.render(d)) response._caller=filter

Commented on:

Remove the excess blank lines that the web2py rendering engine puts in its output.

Hosting graciously provided by:
Python Anywhere