如何在包含引号的内联样式的百里叶中显示HTML
我想在百里叶模板中显示一些HTML样式文本。要显示html,我正在使用th:utext =“ $ {myVariable}”
,但是,我遇到了一个错误:
元素类型“ span”必须随后是任一属性规格,“>”或“/>”。
可能是因为HTML看起来像这样:
<p><span style="color: rgba(0,0,0,0.85);background-color: rgb
(255,255,255);font-size: 14px;font-family: -apple-system,
BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto
Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji;">This is my styled text.</span> </p>
如您所见,它具有包含“”的内联样式,因此Thymeleaf无法处理。知道我该如何解决这个问题?
I've some html styled text that I want to display in the Thymeleaf template. To display the html, I'm using th:utext="${myVariable}"
, however, I'm getting an error:
Element type "span" must be followed by either attribute specifications, ">" or "/>".
It's may be because the html looks like this:
<p><span style="color: rgba(0,0,0,0.85);background-color: rgb
(255,255,255);font-size: 14px;font-family: -apple-system,
BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto
Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji;">This is my styled text.</span> </p>
As you can see, it has inline styles that are contained with "", so thymeleaf is unable to process it. Any idea how can I resolve this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论