0
votes

This question was previously posted to the TinyMCE HowTo Forum with no responses. Here's hoping that someone out there has encountered (and solved) this issue.

The question: Is there some way to enable correct copy/paste of formatted text from a Lotus Notes email directly into TinyMCE?

The scenario: A rolling comments system on a web site, into which users occasionally need to paste rich text from an email viewed in Lotus Notes.

The details:
I have tried copying some formatted text from emails viewed in Lotus Notes (7.0.4, Windows XP) and pasting it into the "Full featured example" implementation of TinyMCE at http://tinymce.moxiecode.com/examples/full.php and found that it generally fails to maintain the formatting. In fact, of the browsers I tested, IE6 fared the best, and the more modern W3C standards compliant browsers were the worst.

Some text formatting I tested was:
larger text
underline
italics
bold
numbered list
bullet list
indented text
permanent pen
font family: arial
font family: times new roman

Results:
-Firefox (3.6.8), Vista or XP: all formatting lost
-Chrome (5.0.375.125), Vista or XP: all formatting lost, including line breaks
-IE6 (XP): some formatting is maintained (fails to copy numbers and bullets for lists, but indents lists properly)
-IETester (IE6) Vista: some formatting is maintained (fails to format lists at all, and the underline tag is not closed)
-IE7 (XP): some formatting is maintained (fails to format lists at all, and the underline tag is not closed)
-IE8 (Vista): some formatting is maintained (fails to format lists at all, and the underline tag is not closed)

If I first paste the clipboard from Lotus Notes into MS Word 2003 (11.5604.5606) it shows perfectly in Word, and if I then copy/paste it from there into TinyMCE it generally works better enough to be usable, although still loses some formatting, even when using the "Paste from Word" button in TinyMCE. Not surprisingly, if I open my Lotus Notes mail in a web mail client, the HTML mail copies and pastes perfectly into TinyMCE.

Since it shows perfectly in my Domino web client, and pastes perfectly into MS Word, it is obviously possible to copy/paste Lotus Notes formatting.

If anyone has had success with this please mention your Notes and browser versions, and any modifications you had to make to the TinyMCE config.

4
Are you using the paste plugin?Thariama
Yes, the paste plugin is included.machinatus

4 Answers

1
votes

If you check what's pasted from Word, you'll find that it's pretty much what you'd get if you had done a File->Save As->Web Page in Word: a whole bunch of Word-specific HTML attributes and CSS. Essentially, it's Word's ability to be coerced into exporting HTML that does the trick; Word's rich text alone won't do the job. The Notes clipboard (which is different from the system clipboard) can export RTF to the system clipboard, which then pastes (with limitations) to Word (which can interpret RTF), but a JavaScript widget in the browser doesn't understand RTF.

1
votes

You can use the w32 api to do your formatted copy (e.g. make a special copy btn in LotusScript and call it). I have actually done this, and it works fine.

however, will TinyMCE handle the paste operation well? - that I cannot tell you.

0
votes

I have logged this as a bug against TinyMCE.

0
votes

Ok, then eigther you will need to deactivate the paste plugin and write a plugin of your own or you will have to configure/change the paste plugin to your needs.

If I first paste the clipboard from Lotus Notes into MS Word 2003 (11.5604.5606) it shows >perfectly in Word, and if I then copy/paste it from there into TinyMCE it generally works >better enough to be usable,

Thing is, that your OS detects (at least sometimes) from which kind of context (plain text, html,...) copy-paste is done. That probably is the reason why copying it first into Word helps a bit.