Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html markup in Play Framework messages

I'm using the Internationalisation messages file in Play. In my messages.en file I have:

support.msg=Click here to contact <a href="support.html">support</a>

but this gets output as

&lt;a href=&quot;support.html&quot;&gt;support&lt;/a&gt;

Is it possible to escape html in messages.en file so they are output 'as is'

like image 521
Kevin Avatar asked Sep 24 '12 13:09

Kevin


1 Answers

By default, Play! automatically escapes strings used in a view. If you'd like to output raw text (including the HTML), wrap the variable in Html().

Example from the docs:

<p>
  @Html(article.content)    
</p>
like image 167
Andrew Conner Avatar answered Oct 04 '22 06:10

Andrew Conner