Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TinyMCE: Force paste from word option [duplicate]

Tags:

tinymce

I am using TinyMCE only to paste from word. What I am doing actually is that I am using the paste from word button and then I am pasting inside.

I would like to enable the paste from word function automaticaly on each paste so the user do not need to click the paste from word button and then paste in the second window.

I am using the paste from word because of all the styles added when pasting from word which I don't need.

Here is an example of html text I am getting when I am using the simple paste option:

<!--        @page { margin: 0.79in }        P { margin-bottom: 0.08in; direction: ltr; color: #000000; line-height: 0.24in; text-align: justify; widows: 2; orphans: 2 }        P.western { font-size: 12pt; so-language: en-US }       P.cjk { font-family: "Times New Roman"; font-size: 12pt; so-language: de-DE }       A:link { color: #0000ff; so-language: zxx } --> Global Health Governance

And I need only Global Health Governance.

Thank you very much.

like image 779
Milos Cuculovic Avatar asked Mar 31 '26 12:03

Milos Cuculovic


1 Answers

In this case you will need to implement this functionality using the tinymce configuration setting paste_preprocess. Eighter surf through the tinymce source code (probably the paste plugin under js_scripts/tiny_mce/plugins/paste/editor_plugins_src.js and put the relevant code there or you implement it as i mentioned in another stackoverflow question: TinyMCE Paste As Plain Text

like image 112
Thariama Avatar answered Apr 03 '26 17:04

Thariama



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!