<script>
    // tinymce.init({
    //     selector: 'textarea',
    //     plugins: 'anchor autolink charmap codesample emoticons image link lists media searchreplace table visualblocks wordcount',
    //     toolbar: 'undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | link image media table | align lineheight | numlist bullist indent outdent | emoticons charmap | removeformat',
    // });

    tinymce.init({
        selector: '.tinyMCE',
        height: 400,

        plugins: [
            'anchor autolink charmap codesample emoticons image link lists media',
            'searchreplace table visualblocks wordcount'
        ],

        toolbar: 'undo redo | blocks fontfamily fontsize | ' +
            'bold italic underline strikethrough | ' +
            'link image media table | ' +
            'align lineheight | numlist bullist indent outdent | ' +
            'emoticons charmap | removeformat',

        setup: function(editor) {
            editor.on('change keyup', function() {
                editor.save(); // 🔑 pushes content back to textarea
            });
        }
    });
</script>
