JSFiddle - React, Tailwind, and code Playground

by fparent

JavaScript

(function() {
    'use strict';

    tinymce.PluginManager.add('my_mce_button', function( editor, url ) {
        editor.addButton( 'my_mce_button', {
            title: 'Red Six Components',
            icon: 'icon redsix-mce-icon',
            type: 'menubutton',
            menu: [
                {
                    text: 'Text Styles',
                    menu: [
                        {
                            text: 'Superscript',
                            onclick : function() {
                                editor.focus();
                                editor.selection.setContent('<sup>' + editor.selection.getContent() + '<sup>');
                            }
                        }
                    ]
                },
            ]
        });
    });
})();