gmuhammad
gmuhammad

Reputation: 1438

alternate for @Html in Japid

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.

Upvotes: 0

Views: 141

Answers (2)

branaway
branaway

Reputation: 191

Or simply:

~{expr}

~ means escape.

Upvotes: 0

gmuhammad
gmuhammad

Reputation: 1438

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)}

Upvotes: 1

Related Questions