Remove HTML tags in Freemarker Template
I've got a freemarker template that displays the same string in a context where HTML is allowed as well as a context where it is not. Is there a built-in in Freemarker that allows me to entirely remove HTML tags from a string? The following template (assuming there was a built-in remove_html ) <#ftl output_format="HTML"/> <html> <head> <title>${page_title?remove_html}</title> </head> <body> <h1>${page_title?no_esc}</h1> </body> </html> and the model Collections.singletonMap("page_title", "A <strong>Strong</strong> Argument") should lead to <html> <head> <title>A Strong Argument</title> </head>