Availability: >= 3.0

Type: Object Method

Description: Registers a new formatting handler to be used with the callFormatting function.


editor.addFormattingHandlerstring handlerid, function function );

This method registers a new formatting command that can be used with the callFormatting method. 


An id name for the command. If you register a new handler for an existing command it's functionality will be replaced by your new handler.

When this value is passed as the first parameter of the callFormatting method the formatting will be handled by your function.

JavaScript function to handle the new formatting command.

When your formatting command is called it will be passed 3 parameters. The first will be the current editor object, the second will be the ID of the formatting command (this allows one function to handle several commands) and lastly an optional value.