Textbox.io 2.x Documentation : editor.filters.selector.addOutput()

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

selectorStringSpecify a CSS3 selector representing the elements you wish to pass to the filter.
callbackFunctionSpecify a function to process the array of matched elements.

Returns

No return value.

See Also

Filtering Content