Create a selector based output filter for an editor instance with editor.filters.selector.addOutput()
.
The selector based output filter modifies content requested from an editor with: editor.content.get()
.
Example
editor.filters.selector.addOutput(selector, callback)
// Create an output filter for elements with class 'green' that strips classes from identified elements editor.filters.selector.addOutput('.green', function(elements) { elements.forEach(function(element) { element.className = ""; }); });
Parameters
selector | String | Specify a CSS3 selector representing the elements you wish to pass to the filter. |
callback | Function | Specify a function to process the array of matched elements. |
Returns
No return value.