BekaD12
5 years agoHelper
Emoji and truncate
Hi all,
I try to use the allow allowElement combined with the html.truncate.
My problem is whenever emoji are inside my html, they don't display.
Did someone have a solution ?
My code :
<#assign messageId = 2505 />
<#assign response = restApiV2Utils.doQuery("SELECT id, subject, body FROM messages WHERE id = '${messageId}'") />
<#assign stripperOptions = utils.html.stripper.from.owasp.optionsBuilder
.allowElement("p")
.allowElement("span")
.allowElement("img")
.build() />
<#assign strippedBody = utils.html.stripper.from.owasp.strip(messages.body, stripperOptions) />
<p class="truncate">${utils.html.truncate(250, strippedBody, "...")}</p>