tinymce-rails icon indicating copy to clipboard operation
tinymce-rails copied to clipboard

Paste plugin - Cannot read property 'elements' of undefined

Open Pacn91 opened this issue 5 years ago • 0 comments

Hi, I'm getting the follow error after adding the paste plugin and setting to true the paste_as_text in the tinymce.yml file.

screenshot_1

I get immediately that error when I press CTRL+V, not allowing me to paste the content.

Here is my tinymce.yml file:

plugins:
  - paste
toolbar:
  - styleselect | bold italic | undo redo | paste
remove_linebreaks: true
forced_root_block: false
paste_as_text: true

Am I doing something wrong or is this a bug? I'm just trying to get no styles when I copy paste from word. Maybe you can help me! Thank you in advance

UPDATE If I remove the paste_as_text from the conf file, no error is originated. So I tried the follow combination (paste_enable_default_filters: false and paste_word_valid_elements: "i,em"), but seems that they aren't working too. Also the button paste is not working too.

plugins:
  - paste
toolbar:
  - styleselect | bold italic | undo redo | paste
remove_linebreaks: true
forced_root_block: false
paste_enable_default_filters: false
paste_word_valid_elements: "i,em"

Pacn91 avatar Dec 11 '18 12:12 Pacn91