gpt4 book ai didi

javascript - 使用 CKEditor 内置的白名单引擎在 JavaScript 中清理 HTML

转载 作者:行者123 更新时间:2023-11-29 19:15:00 26 4
gpt4 key购买 nike

有没有办法使用 CKEditor (4.4.x) 内置的白名单引擎来清理 JavaScript 中的 HTML?我的意思是,假设我已经在我的页面中加载了 CKEditor,并且我有一个包含 HTML 的字符串变量,有没有办法在该字符串上调用 CKEditor 过滤器来获得经过清理的白名单版本?

最佳答案

嗯,看起来它可能是 CKEDITOR.instances['myCKEInstance'].dataProcessor.toHtml(myHTMLstring)

http://docs.ckeditor.com/#!/api/CKEDITOR.htmlDataProcessor

关于javascript - 使用 CKEditor 内置的白名单引擎在 JavaScript 中清理 HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36013824/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com