当我使用 ckeditor 工具栏时,它会添加 html 标签,而不是在显示时添加所需的效果

When I use ckeditor toolbar, it adds html tags instead of adding desired effects while displaying

本文关键字:添加 显示 html ckeditor 工具栏 标签      更新时间:2023-09-26

我正在使用ckeditor,当我在grails 1.3.7中使用它时,它工作正常。现在我将我的代码库更新到 grails 2.2.4 和 ckeditor 给了我一些问题。

当我编写一些东西并使用工具栏对其进行格式化时,我得到包含html标签的输出。例如

我选择粗体并写一些"这是文本"它产生输出

<b> This is a text </b>

我应该在配置中添加什么以使其工作吗?

试试这个。

<ckeditor:editor name="${name}" height="100px" width="98%" toolbar="Mytoolbar">
    ${myText?.decodeHTML()}
</ckeditor:editor>

它会提供您想要的任何输出。

享受。

这是我

的文本(data.bodyText)

<p><br/>Hi<br/> Long Text... &amp;nbsp;&lt;em&gt

删除我使用的所有 html 标记

$('<div/>').html(data.bodyText).text()