Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2221 (closed defect: wontfix)

Opened 10 years ago

Last modified 10 years ago

Mako template engine always escapes html

Reported by: kikidonk Owned by:
Priority: normal Milestone: 2.0rc1
Component: TurboGears Version: trunk
Severity: normal Keywords:
Cc:

Description

Imagine I wanted to render a plain-text template for inclusion in an email using mako. Currently if i just use the tg.render function, the fields will be html-escaped which doesn't make sense in a text-template.

This is because there is a default filter setup in the TemplateLoader? to esapce everything with paste's escape function.

What is the correct solution here.. i don't really know.

A workaround is to use the ${xxx|n} filter to prevent html escaping in a text template

Change History

comment:1 Changed 10 years ago by mramm

You can also make a plain text mako renderer, or just use mako to generate your plain-text response in the controller manually.

I know there should be one, and preferably only one right way to do it, but that's not going to happen here, but what what we *do* need to do is pick a way and document it.

comment:2 Changed 10 years ago by mramm

  • Milestone changed from 2.0 to 2.0rc1

comment:3 Changed 10 years ago by mramm

  • Status changed from new to closed
  • Resolution set to wontfix

We've now documented how to make a text_mako renderer (or other render function) with different defaults, so this is good enough for now.

We may want to add additional config options in 2.1

Note: See TracTickets for help on using tickets.