1

If I copy text from Word that contains bolded characters and paste it into a contenteditable DIV in IE the bolded characters are preserved. However, if instead I get the text from the clipboard via Javascript using the window.clipboardData.getData() method then I receive the text in plain-text with \r\n characters where the line breaks should be, but I don't see any indication of what text might be bold.

Is it possible that the 'bold' marker is using some sort of non-printing character in the text that I could detect and replace with a <b> tag? If so what is that character?

I notice that if I go use Word online then it is able to preserve the bold text in pasted content from IE so it seems possible, but I have no idea how they're doing it.

Wally Lawless
  • 7,539
  • 7
  • 37
  • 53
  • Hi, no.... copyclipboarddata is plain text (utf-8). Word and Office documents use RichText which includes the markup for decorated text... When you paste back into a word document you will see two options for pasting .. rich text and plane text. see also http://stackoverflow.com/questions/28983016/how-to-paste-rich-text-from-clipboard-to-html-textarea-element – Rob Parsons Jul 10 '15 at 02:00

0 Answers0