Pasting formatted text (e.g. Word) to a textarea

4.9k views Asked by At

When you paste, via the clipboard, some formatted text (e.g. from MS Word) to a textarea, it seems that not just formatting is lost. For example, I've tested that non breaking spaces are converted to normal whitespaces. Could you explain what happens here, and tell me if it's possible to gain control, using Javascript, over clipboard content before it is pasted, so some processing can be done?

Non-breaking spaces are just an example. In fact, I'd be very interested to be able to preserve some basic formatting information (italic, bold), that would be displayed in the textarea using the appropriate HTML tags.

0

There are 0 answers