New Play Scala Template HTML Escaping

842 views
Skip to first unread message

Jay Taylor

unread,
Jun 1, 2011, 1:54:01 PM6/1/11
to play-framework
Does the new Play Scala template system escape HTML? How can I force
escaping or allow raw HTML?

Thanks!
Jay

Guillaume Bort

unread,
Jun 1, 2011, 1:58:50 PM6/1/11
to play-fr...@googlegroups.com
Yes any output will be escaped and wrapped in a play.templates.Html type.

So if you want to control the escaping mechanism, just make your
dynamic expression directly return Html:

@Html("<strong>Do not escape</strong>")

> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>
>

--
Guillaume Bort, http://guillaume.bort.fr

Jay Taylor

unread,
Jun 1, 2011, 5:10:41 PM6/1/11
to play-framework
This is working as described. Thanks for the super quick response-

On Jun 1, 10:58 am, Guillaume Bort <guillaume.b...@gmail.com> wrote:
> Yes any output will be escaped and wrapped in a play.templates.Html type.
>
> So if you want to control the escaping mechanism, just make your
> dynamic expression directly return Html:
>
> @Html("<strong>Do not escape</strong>")
>
Reply all
Reply to author
Forward
0 new messages