Documentation

Format

format

Arguments
type Stringinline or block type of formatting
nodes Arrayarray of nodes which resulted from formatting

Triggered both for inline or block tags formatting.

$R('#content', {
    callbacks: {
        format: function(type, nodes)
        {
            // ...
        }
    }
});

Listen to the message in a plugin:

(function($R)
{
    $R.add('plugin', 'myplugin', {
        init: function(app)
        {
            // define app
            this.app = app;
        },

        // messages
        onformat: function(type, nodes)
        {
            // ...
        }
    });
})(Redactor);