alternate for @Html in Japid

143 views Asked by At

In play framework we use @Html in scala views if we do not want play to escape Html characters. Is there any alternate to this in Japid. I tried to import play.api.templates.Html and tried ${Html and ${Html.get but they are not working. Am I doing something wrong.

2

There are 2 answers

0
gmuhammad On BEST ANSWER

Japid by default does not escape the string value of expressions to make it html safe, like what Play! does.

Reference: https://github.com/branaway/Japid/blob/master/documentation/manual/Japid_Generic_Engine.textile

In case you need to explicitly escape the string value of expression, you can use:

${escapeHtml(expr)}
0
branaway On

Or simply:

~{expr}

~ means escape.