我努力在SpringBoot1.3.5中传递HTML模板,它依赖于旧的Thymeleaf2.x系列
script
标签:
<script type="text/template" id="catTmpl">
<![CDATA[
<b><%=name%></b>
]]>
</script>
这导致了错误:
org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
undescore.js
就我而言):
_.template($("#catTmpl").html())
我看到一些博客,发现Thymleaf 3使用了不同的解析器。选中的:
$ gradle dependencies
| | +--- org.thymeleaf:thymeleaf:3.0.6.RELEASE
| | | +--- org.attoparser:attoparser:2.0.4.RELEASE
该解析器假设
包含CDATA和以上代码在没有CDATA的情况下可以正常工作。
是什么
attoparser
Thymeleaf 3准备好通过传递HTML模板了吗
(或HTML 5
template
)标签没有CDATA废话?