views:

557

answers:

5

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.

A: 

I am facing the same issue. I need to paste a table sent by email into the TinyMCE in order to update a web page. I am using IBM Lotus Notes 8.5 and viewing in IE 8. If i paste into word the table is fine, but if i paste into TinyMCE it looses all table formatting.

JJBeans
FYI, I have found that for Internet Explorer, Xinha works a little bit better, but neither it nor CKEditor work in Firefox.Xinha: http://xinha.webfactional.com/
machinatus
A: 

I have logged this as a bug against TinyMCE.

machinatus
A: 

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.

Thariama
+1  A: 

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.

Stan Rogers
Thank you for the clear explanation, Stan (namesake to one of my absolute favourite musicians). Much appreciated. I never did like Lotus Notes anyway, but it's one of the "industry standard" apps. Anyway, I suppose it is not too surprising that IE (being MS) handles RTF paste (somewhat) while Firefox does not at all.A quick search on "RTF to HTML converter" came up with only some MS native applications.
machinatus
A: 

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.

Timothy Nichols