从 Freemarker 节点逐字插入 HTML
Insert HTML verbatim from Freemarker node
我有以下 Freemarker 代码:
<#macro table_container>
<div class="table content">
${.node}
</div>
</#macro>
现在节点包含我不想被 Freemarker 解析的 HTML(对于 table)。我只想按原样插入。目前我收到此错误:
freemarker.template.TemplateModelException: Only elements with no child elements can be
processed as text.
This element with name "table_container" has a child element named: table
如何让 Freemarker 逐字插入此 HTML?
${.node.@@markup}
,或者如果您在 #escape
、<#noescape>${.node.@@markup}</#noescape>
内。尽管它会为每个这样的插入添加所需的 xmlns
属性,但它有一点点丑陋。
我有以下 Freemarker 代码:
<#macro table_container>
<div class="table content">
${.node}
</div>
</#macro>
现在节点包含我不想被 Freemarker 解析的 HTML(对于 table)。我只想按原样插入。目前我收到此错误:
freemarker.template.TemplateModelException: Only elements with no child elements can be
processed as text.
This element with name "table_container" has a child element named: table
如何让 Freemarker 逐字插入此 HTML?
${.node.@@markup}
,或者如果您在 #escape
、<#noescape>${.node.@@markup}</#noescape>
内。尽管它会为每个这样的插入添加所需的 xmlns
属性,但它有一点点丑陋。