TinyMCE editor upgrade
I’m happy to announce that, after a quite long time, we finally upgraded the TinyMCE editor. The new EPiServer.CMS.TinyMce package contains integration with latest version of the TinyMCE 6 library.
In this release we haven't added new functionalities, but have focused on the library migration.
Configuring editor
We have not changed the way TinyMCE is configured. We are still using TinyMceConfiguration option:
context.Services.Configure<TinyMceConfiguration>(config =>
{
// Add content CSS to the default settings.
config.Default()
.ContentCss("/static/css/editor.css");
// Limit the block formats for the MainBody property of an ArticlePage.
config.For<ArticlePage>(t => t.MainBody)
.BlockFormats("Paragraph=p;Header 1=h1;Header 2=h2;Header 3=h3");
});
There are no new extension methods added for our integration, but there were significant breaking changes in the TinyMCE library. All custom plugins have to be updated. To do that you should follow the migration guide migration from 4x, migration from 5x and how to migrate from tinymce 4 to tinymce 5. Please note that TinyMCE 5 and TinyMCE 6 API are very similar. Version 6 mainly removed obsolete methods.
In the documentation above you can for example find that some plugins are not free anymore (Image tools, Spellchecker, Table of Contents) and some were move to the core package (print, paste, colorpicker, contextmenu, textcolor). Those plugins should be removed from TinyMCE configuration if they were used.
All custom plugins code has to be revisited. There is not jQuery support anymore and there are API changes around registering button, icons, menus, etc. The latest documentation version about creating a custom plugin can be found here.
Built-in TinyMCE spell checker
From EPiServer.CMS.TinyMce 4.0.0, the EPiServer.TinyMCESpellChecker plugin will be included in core page. The EPiServer.TinyMCESpellChecker should be uninstalled since it won't be available as a separate package for EPiServer.CMS.TinyMce 4 and above.
Paste plugin
The standard paste plugin is now part of TinyMCE core package. The paste functionality no longer supports pasting from Word. When pasting from Word, the PowerPaste premium plugin should be used.
Comments