【问题标题】:How to set the content of a g:textArea as HTML (formatted text, not code) in grails如何在 grails 中将 g:textArea 的内容设置为 HTML(格式化文本,而不是代码)
【发布时间】:2013-01-16 20:01:59
【问题描述】:

我正在编写一个小型 grails 应用程序。

在一个动作中,显示,“show.gsp”页面被调用,其中是一个文本区域:

如'value'所示,value是一些格式化的文本(即HTML)如:

<p>Writing some html </p>
<p>we can <strong>bold</strong> it</p>
<p>and <em>italic</em> it</p>
<p>and send it!</p>
<p>sean</p>
<p> </p>

但是,而不是显示为:

编写一些 html

我们可以加粗

斜体

然后发送!

肖恩

 


HTML 显示为代码(我假设 html 被转义,即使我设置了属性 escapeHtml="false"。

或者,我有错吗?我还能如何将 HTML 作为格式化文本插入到 textArea 中?

谢谢!

肖恩

【问题讨论】:

  • 文本区域不显示 html,它们显示文本。

标签: html grails formatting textarea gsp


【解决方案1】:

使用 textarea 你不能。尝试使用所见即所得的编辑器,例如CKEditor

【讨论】:

    猜你喜欢
    • 2018-02-26
    • 2018-07-12
    • 1970-01-01
    • 1970-01-01
    • 2016-10-28
    • 1970-01-01
    • 2015-07-03
    • 2014-05-21
    • 1970-01-01
    相关资源
    最近更新 更多