When copypasting from OpenOffice (Linux) to a TMCE text area, it depends on sheer luck whether the topic will survive. I could reduce it to the difference whether the OO stuff gets pasted within a
<p>
element or not, and the reason being that OO creates a bunch of
<META>
elements before the contents. To reproduce you'll need to paste the following stuff into TMCE's HTML editor, I found no better way of visualisation:
Forget that I said that. I saved this topic and only then realized that I had the forbidden HTML comment included. Rats.
Starting over: You need to snatch the HTML comment saying "WYSIWYG content" from somewhere and add it. I can't here, because the TMCE plugin will then wreak havoc on the topic. Another way to reproduce is to start with a completely empty topic and then paste OO stuff in.
The following is OK:
<p>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8">
</p>
<p>Topic content</p>
The following results in an empty topic:
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8">
<p>Topic content</p>
I guess that Firefox kills the element containing the offending META, but auto-generates a closing
</p>
if the META comes after an opening
<p>
.
Setting to "normal" for the moment, should be raised if it affects other scenarios, too.
Hasn't this one haunted Kupu, too?
--
TWiki:Main/HaraldJoerg - 16 Oct 2007
Addendum: Copypaste from MS Windows / MS Word to both Firefox/TMCE and IE6/TMCE works fine, even if I replace the whole document. For complex MS Word layouts the result contains a lot of HTML, but as long as you stick to TMCE, you wouldn't notice.
--
TWiki:Main/HaraldJoerg - 17 Oct 2007
I'm not terribly sure what steps to follow to reproduce this problem. Can you give me a step-by-step please?
CC
The easiest way may be the following:
- Create a document (just a heading and one line will do) in OpenOffice. I'll attach a sample as https://develop.twiki.org/pub/Bugs/Item4836/TMCEdemo.odt (download, don't just click. develop.twiki.org serves as text/plain).
- Create an empty topic (not even containing a signature), which per default will lauch TMCE
- In HTML view, the topic should only contain the indicator comment (which apparently is visible in Firefox on Linux, but not in IE on Windows?!?)
- In OpenOffice, hit [CTRL]-A (select all) and [CTRL]-C (copy to clipboard)
- Set focus on TMCE's text area, hit [CTRL]-V (paste)
- Save
- The topic is contains no text.
- If you go "back" in your browser, it is still there. If you "Edit" again, it is lost.
I could reproduce this at
OpenOfficeCopyPaste. And by the way, the first attach took more than four minutes to complete, while the second was instantaneous. I seem to recall that others made the same observation, too, but would think it is a server and not a code issue.
--
TWiki:Main.HaraldJoerg - 18 Oct 2007
Thanks, I was able to reproduce that.
The problem is that HTML::Parser doesn't recognise META as a self-closing tag. That means <META is interpreted as opening a <META>..</META> block, which doesn't get closed until the end of the topic text. Since the translator then goes on to ignore META blocks, the content is lost.
The solution is to make the HTML::Parser recognise META, i guess.
CC
Should be better now
CC
Now it works with exactly the same setup (Firefox, OpenOffice, Ubuntu) where it failed before. Better, indeed
--
TWiki:Main.HaraldJoerg - 12 Nov 2007