5

Im trying to create a contenteditable div with the behaviour of chrome's 'plaintext-only'. So, users can only input plain-text and when copying rich-text it is pasted as plain-text. In my script @-mentions are converted to buttons and added using Rangy.js

In normal contenteditable div's rich-text can be pasted in and I need to convert that to normal text. The only problem is is detecting what is pasted, then convert it to text and insert it at the right position and after restore the carrot position. It is even harder when more text is selected over more lines.

Do I think to hard and is there a more simple solution? Or anyone can suggest the most light weight editor?

thanks!

Gilbert
  • 177
  • 2
  • 12

0 Answers0