Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

playframework 1.2. insert raw html into template?

Assume the template consists of only one variable:

${htmlString}

and the corresponding Controller:

render("<div>some html markup</div>");

As a result i get an escaped string, but want to get the original html. Is there any way to do this?

like image 375
sdespolit Avatar asked Oct 27 '11 16:10

sdespolit


2 Answers

You can use ${mystring.raw()} i think. Or embed it inside a #{verbatim} tag. -morten

like image 111
mbknor Avatar answered Nov 15 '22 20:11

mbknor


In the Play2 template engine the escaping is done like this:

@Html("\n<br>")

(Source)

like image 29
OlivierBlanvillain Avatar answered Nov 15 '22 20:11

OlivierBlanvillain