cleanup html tags Developer Jahia 7.3 Jahia 8

How to convert HTML code to text

Question

I want to extract long description in a list

Answer

An easy way is to use the removeHtmlTags function. It works like this:

<%@ taglib prefix="functions" uri="http://www.jahia.org/tags/functions" %>
...
<c:set var="myText" value="${currentNode.properties.myText.string}"/>
${functions:removeHtmlTags(myText)}

You can also use this static function org.jahia.taglibs.functions.Functions.removeHtmlTags from a groovy script!