Hi folks,
My java class passes a string with html tags such as test (with bold tags)I wonder what should I do on the freemarker side to render 'test' as bold? I tried escape/no escape on freemarker and they didn't work. The string comes from java always renders literally instead of rendering as html tags.
I tried StringEscapeUtils.escapeHtml in java but ftl will display with 'less than' 'greater than' symbols.
Any suggestions? Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
${myVar} will insert any HTML content as is, unless you are inside an #escape. So I'm not sure what's going on there. What will ${'<b>foo</b>'} print? And <#noescape>${'<b>foo</b>'}</#noescape>?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi folks,
My java class passes a string with html tags such as test (with bold tags)I wonder what should I do on the freemarker side to render 'test' as bold? I tried escape/no escape on freemarker and they didn't work. The string comes from java always renders literally instead of rendering as html tags.
I tried StringEscapeUtils.escapeHtml in java but ftl will display with 'less than' 'greater than' symbols.
Any suggestions? Thanks!
${myVar}
will insert any HTML content as is, unless you are inside an#escape
. So I'm not sure what's going on there. What will${'<b>foo</b>'}
print? And<#noescape>${'<b>foo</b>'}</#noescape>
?