保存前解析并添加额外数据到 CKEditor

发布于 2024-10-09 02:53:14 字数 128 浏览 0 评论 0原文

我正在使用 CKEditor。

我需要在 CKEditor 输出的 html 周围添加文本(即 html 输出周围的开始和结束标记;而不是 html 标记)。

有什么办法可以做到这一点吗?

谢谢

I'm using the CKEditor.

I need to add text around the html outputted by CKEditor (i.e., an opening and closing tag around the html output; not an html tag).

Is there any way of doing this?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暮倦 2024-10-16 02:53:14

您可以通过 .getData() 在编辑器中获取 html 数据,

这样的东西可能对您有用:

 var wrappedOutput = '<div>'+ CKEDITOR.instances.NameOfEditorInstance.getData() +'</div>';

这里是指向 .getData()

you can get the html data within the editor via .getData()

Something like this might work for you:

 var wrappedOutput = '<div>'+ CKEDITOR.instances.NameOfEditorInstance.getData() +'</div>';

Here is a link to the docs pointing to .getData()

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文