Reputation: 511
I am having a problem in TinyMCE when I use paste_as_text: true
in conjunction with forced_root_block: false
. Pasting already plain-text in works fine, but pasting from Word adds extra <br>
tags between every newline. It's not like I can simply parse these out, because that breaks correct double-newlines from plain text.
I have noticed that pasting with ctrl-shift-v fixes this issue, and would love to make that the default pasting method, but can't find how.
I'm currently trying to write a parser to use in paste_preprocess
, but since it's possible to do in other ways, I figure there must be a better solution.
Upvotes: 5
Views: 1185
Reputation: 10054
Pasting from Microsoft Word is broken in must copy and paste/Cliboard APIs. you will need to modify Newline.js or Clipboard.js manually.
For example, replace line 63 in Newline.js:
return p.split(/\n/).join('<br />');
with:
return p.replace(/\r?\n/g, '<br>');
If you can open an issue on the plugin page, I will create a proper pull request.
Upvotes: 1