问题
I see a lot about this smart Advanced Content Filter
, but it's too smart, it handles HTML elements and doesn't let me do custom filtering. I can't figure out how to strip all inserted HTML comments.
回答1:
Advanced Content Filter does not touch comments. It only filters HTML elements, nothing more.
If you want to strip all comments, then using dataProcessor's filters will be the best choice.
For example to filter them out on input:
CKEDITOR.replace( 'editor1', {
on: {
pluginsLoaded: function( evt ) {
evt.editor.dataProcessor.dataFilter.addRules( {
comment: function() {
return false;
}
} );
}
}
} );
来源:https://stackoverflow.com/questions/19252237/ckeditor-strip-filter-html-comments