tinymce.Formatter

Text formatter engine class. This class is used to apply formats like bold, italic, font size etc to the current selection or specific nodes. This engine was built to replace the browser's default formatting logic for execCommand due to its inconsistent and buggy behavior.

Examples

tinymce.activeEditor.formatter.register('mycustomformat', {
   inline: 'span',
   styles: {color: '#ff0000'}
 });

 tinymce.activeEditor.formatter.apply('mycustomformat');

Constructors

Method Defined By
Constructs a new formatter instance
tinymce.Formatter

Methods

Method Defined By
Applies the specified format to the current selection or specified node
tinymce.Formatter
Returns true/false if the specified format can be applied to the current selection or not
tinymce.Formatter
Executes the specified callback when the current selection matches the formats or not
tinymce.Formatter
Returns the format by name or all formats if no name is specified
tinymce.Formatter
Returns a preview css text for the specified format
tinymce.Formatter
Matches the current selection or specified node against the specified format name
tinymce.Formatter
Matches the current selection against the array of formats and returns a new array with matching for
tinymce.Formatter
Return true/false if the specified node has the specified format
tinymce.Formatter
Registers a specific format by name
tinymce.Formatter
Removes the specified format from the current selection or specified node
tinymce.Formatter
Toggles the specified format on/off
tinymce.Formatter
Unregister a specific format by name
tinymce.Formatter