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

Use the CKEditor built-in whitelist engine to sanitize HTML in JavaScript

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

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

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