AsGoodAsItGets
AsGoodAsItGets

Reputation: 3171

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

Is there a way to use the CKEditor (4.4.x) built-in whitelist engine to sanitize HTML in JavaScript? I mean, let's say I already loaded CKEditor in my page and I have a string variable containing HTML, is there a way to invoke the CKEditor filters on the string to get a sanitized, whitelisted version?

Upvotes: 4

Views: 2186

Answers (1)

AsGoodAsItGets
AsGoodAsItGets

Reputation: 3171

Hmm, looks like it may be CKEDITOR.instances['myCKEInstance'].dataProcessor.toHtml(myHTMLstring).

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

Upvotes: 5

Related Questions