[kupu-dev] Problem when pasting directly from word into kupu on firefox 3

Jasper Op de Coul jasper at infrae.com
Mon Aug 11 16:55:47 CEST 2008


Hi list,

I'm trying to solve a bug in Silva CMS where pasting content directly 
from Word into Firefox3 inserts extra content (CSS definitions that end 
up in the text). I found that the same problem also exists in Plone. I 
tested with Kupu 1.3.9 and 1.4.10.
You can reproduce this by creating a simple word document then 
copy-pasting this directly into Kupu. Initially this all looks fine. But 
when you view source there's already all kinds of extra CSS/tags.
When you save the document, the content will have something like the 
following text added:

Version:1.0 StartHTML:0000000167 EndHTML:0000002949 
StartFragment:0000002532 EndFragment:0000002909 
SourceURL:file:///Z:\home\jasper\var\testfiles\word_test.doc <!-- /* 
Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal 
{mso-style-parent:""; margin:0in; margin-bottom:.0001pt; 
mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New 
Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:NL; 
mso-fareast-language:NL; mso-bidi-language:AR-SA;} @page Section1 
{size:595.3pt 841.9pt; margin:70.85pt 70.85pt 70.85pt 70.85pt; 
mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} 
div.Section1 {page:Section1;} -->

This behavior is a little bit different on linux then on windows, in 
Silva the comment shows up right away, in Plone on windows the comment 
does not show up in the editor but it does show up in the public 
rendering of the page. In linux, the Version/StartHtml lines are also 
visible, on windows this isn't the case.

Note that on Firefox2 and IE, there's all kinds of extra <font> tags, 
but Kupu seems to handle them fine. On Firefox 3, the font tags are not 
there anymore but there are some <style> elements.
It looks like Firefox3 handles the clipboard data differently, or tries 
to sanitize the html and replaces the font tags with css, but there's 
all kinds of extra stuff there that's not shown in Firefox2

I could not find anything about this problem when googling or looking on 
the mailinglist. Did I miss anything, or is this really a serious 
problem. Maybe this should also be posted on the Plone lists?

gr,
Jasper

-- 
Jasper Op de Coul -- Infrae
t +31 10 243 7051 -- http://infrae.com
Hoevestraat 10 3033GC Rotterdam -- The Netherlands


More information about the kupu-dev mailing list