TinyMCE copy and paste from Google Docs or Word

Silverstripe Version:
5.3

Question:

Hi there,

I am looking for some guidance on the use of TinyMCE Editor (6.8.4) in SilverStripe 5.3 regarding the removal of the ‘paste’ plugin.

Does anything know of any workaround solutions to allow the editor to retain some basic formatting (when copying and pasting from word).

Namely, at least: ‘bold, underline and italics’.

I see there’s a ‘PowerPaste’ TinyMCE Premium plugin available, but it is offered only with the Professional plan @ $130 USD per month, so that’s a bit over the top.

Any guidance would be greatly appreciated,
Thanks in advance,
Jim


UPDATE - I have dabbled with these options below, but also looking for clarification or guidance.

Option 1. Install ‘open source plugin’ as referred to in the 5.0.0 change logs.

There appears to be an open source plugin (tinymce-word-paste-plugin) which was referenced in the open call for maintainers

I have experimented with this locally, using Webpack and NPM to produce the distribution package and enabling it like:

$editorConfig = TinyMCEConfig::get('cms');
$editorConfig->enablePlugins([ 'pasteword' => './_resources/client/dist/tinymce-word-paste-bundle.js' ]);

But there’s clearly more to it, and I’m also hesitant at installing a third party plugin.

Question: Is this something we’ll need to wait for TinyMCE to integrate with their core?

Option 2. Install Premium Plugins via TinyMCE Cloud API

Obviously this is not going to happen given that the “PowerPaste” plugin is offered only with the Professional plan @ $130 USD per month.

But regardless, I would like to explore the plugins using the Free plan.

Question:

Does SilverStripe 5.3 TinyMCEConfig allow us to authenticate with TinyMCE Cloud API ? i.e to easily install premium plugins for example?


TinyMCE has explicitly removed this functionality from core so that they can sell the paid plugin. They won’t be adding it back into core.

I don’t know if anyone’s tried that yet. It theoretically should, but I can’t say for sure.

Thanks Guy,

For anyone else in the future, we’re just doing this as a temporary work around.

Step 1: Word - Save as HTML

  1. Open the Word document.
  2. Click File > Save As and choose Web Page (.htm, .html) as the file type.
  3. Save the file. This creates an HTML file but often includes a lot of inline styles and unnecessary markup.

Step 2: Clean the HTML

Simplify the HTML by removing any inline styles.

  • Use an online tool HTML cleaner (at your own caution) or by using your own tool.

Step 3: SilverStripe - Paste the above using the “Source Code” editor function.