Create a predicate based output filter for an editor instance with editor.filters.predicate.addOutput().
The predicate based output filter modifies content when requested from the editor with: editor.content.get().
Example
editor.filters.predicate.addOutput(matchingFn, callback)
// A matching function identifying elements that are not allowed in the output
var disallowed = function(element) {
var name = element.nodeName.toLowerCase()
return name === 'iframe' || name === 'embed';
};
// Create an out filter identifying tags that are not allowed and removing them
editor.filters.predicate.addInput(disallowed, function(elements) {
$(elements).remove();
});
Parameters
matchingFn | Function | Specify a named function that returns the elements you wish to pass to the callback function. |
callback | Function | A function to process the array of matched elements. |
Returns
No return value.
See Also