Ticket #8009 (closed Bug: fixed)

Opened 6 years ago

Last modified 6 years ago

Pasting from OpenOffice broken / mishandled comments

Reported by: miohtama Owned by: duncan
Priority: minor Milestone: 3.1.3
Component: Visual Editor Version:
Keywords: openoffice paste copy html Cc:

Description

OpenOffice 2.2 / Firefox 2.0 / Plone 3.1-rc1.

Cleaning HTML comments/style tags does not work. When you paste text from OpenOffice in Kupu, the edit mode will correctly show


Bohan A, Peter JB. N Engl J Med 1975;292(7):344-7 and 292(8):403-7.

 
Bohan A, Peter JB, Bowman RL, Pearson CM. Medicine (Baltimore);1977;56:255-86.


But after save, the page reads

 
<!-- @page { size: 8.27in 11.69in; margin: 0.79in } P { margin-bottom: 0.08in } -->

 

Bohan A, Peter JB. N Engl J Med 1975;292(7):344-7 and 292(8):403-7.

 

Bohan A, Peter JB, Bowman RL, Pearson CM. Medicine (Baltimore);1977;56:255-86.



Change History

comment:1 Changed 6 years ago by hannosch

  • Milestone changed from 3.1 to 3.x

comment:2 Changed 6 years ago by duncan

  • Status changed from new to closed
  • Resolution set to fixed

It isn't that comments don't work: the openoffice paste contains a style tag and the content of that style tag is not html so the <!-- whatever --> is actually plain text not an html comment. Kupu was stripping out the style tag as not permitted, but leaving its content. This was the wrong action for style and script tags, so I've made it that when script or style tags are stripped their content is also removed. There's are some follow-on issues from this:

when you paste form OpenOffice Firefox sometimes manages to create nested paragraph tags which it then cleans up on save (or when switching to HTML view). This was creating spurious blank paragraphs from the pasted whitespace. I've changed the cleanup code to filter out whitespace in this situation.

The pasted HTML also contains meta tags and a title tag. I've added these to kupu's internal blacklist as I don't think kupu should ever be generating code containing them.

Fixed in SVN revision 54983

Note: See TracTickets for help on using tickets.