#1537 closed Bug (fixed)
Forced <p> on paste
Reported by: | MiksIr | Owned by: | Martin Kou |
---|---|---|---|
Priority: | Normal | Milestone: | FCKeditor 2.6.5 |
Component: | Plugin : Paste from Word | Version: | FCKeditor 2.6.4 |
Keywords: | Confirmed Review+ | Cc: |
Description
When paste paragraph from Word (I am not check other sources) the empty paragraph (<p> </p>) is forced.
This is nodes of FCKeditor before insert (empty document):
<body spellcheck="false"> <p> <br type="_moz"/> </p> </body>
and this is after paste:
<body spellcheck="false"> <p/> <p class="MsoNormal" _moz_dirty=""> <span lang="EN-US" style=""> It’s a test </span> </p> </body>
Sure, use "Word paste" make the same result.
Attachments (2)
Change History (14)
comment:1 follow-up: 2 Changed 17 years ago by
Keywords: | Pending WorksForMe added |
---|
comment:2 Changed 17 years ago by
Replying to w.olchawa:
Maybe you are referring to the problem that a <p> tag is inserted on paste even though your configuration is set to FCKConfig.EnterMode = 'br'; . Please let us know if it is the problem that you are coping with.
Thanks
I do have that problem! When pasting under certain circumstances the content becomes wrapped with a <p> tag. Its hard to remove that tag but manually through source HTML (what I don't want to leave to the user) I still don't know those circumstances. Sometimes that happens, and others doesn't. I only know that when a <p> tag appears at content's boundaries, it gets too difficult to remove. I found only an unanswered question about that at the forum. Some solution? Thanks
comment:3 Changed 17 years ago by
Persistent problem noticed even in IE7, Firefox and Safari, and other browsers that extra unwanted <p> get inserted around editor text when you switch back and forth between source view and WYSIWYG mode. This problem is reflected in various forms in all the bugs reported in this forum around <p> tag related issues.
comment:4 Changed 16 years ago by
Keywords: | Pending removed |
---|
comment:5 Changed 16 years ago by
I've found that forced paragraph on paste is caused by FCK function InsertHtml. When you create some headings like:
<h2>blabla</h2>
and then you paste from word the empty paragraph between is created (If not, switch the source button and back).
In _source/internals/fck_ie.js is:
// Using the following trick, any comment in the beginning of the HTML will // be preserved. html = '<span id="__fakeFCKRemove__" style="display:none;">fakeFCKRemove</span>' + html;
// Remove the fake node FCK.EditorDocument.getElementById('__fakeFCKRemove__').removeNode(true);
When i comment this lines no empty paragraph was created. So, this workaround will probably also disable including HTML comments inside?? But i hope that it will be helpful for someone.
comment:6 Changed 16 years ago by
Keywords: | Confirmed Review? added; WorksForMe removed |
---|---|
Owner: | set to Alfonso Martínez de Lizarrondo |
Status: | new → assigned |
Version: | SVN (FCKeditor) → FCKeditor 2.6.4 |
The reproduction steps are:
- Modify the InsertHTML function in sample08, so it inserts this:
oEditor.InsertHtml( '<h2>Test</h2><p>- This is some <a href="/Test1.html">sample<\/a> HTML -</p>' ) ;
- Now put the cursor at the beggining of the text and press the insert Html button.
- Looking then at the source will reveal in IE that a <p> is present before the inserted contents. In Firefox the new content is inside the existing <p> (wrongly nested)
The patch just fixes the IE issue based on the comment by Adam.Cap, but it doesn't do anything for other browsers or other situations.
comment:7 Changed 16 years ago by
Milestone: | → FCKeditor 2.6.5 |
---|
Setting milestone to move it away from the top in the pending review list. Even if the patch is checked in, the ticket can't be closed.
comment:8 Changed 15 years ago by
Keywords: | Review- added; Review? removed |
---|---|
Owner: | changed from Alfonso Martínez de Lizarrondo to Martin Kou |
Status: | assigned → new |
There's a more serious problem here - when the test message is pasted via the Paste From Word dialog inside a paragraph, the paragraph is not split. This is causing the empty paragraph to appear in Firefox.
We can only fix these for the Paste from Word dialog, though. If you paste via Ctrl-V, the paste logic is handled by the browser and it's not our fault that it breaks.
Changed 15 years ago by
Attachment: | 1537_2.patch added |
---|
comment:9 Changed 15 years ago by
Keywords: | Review? added; Review- removed |
---|
Added a fix to the same problem in Firefox.
comment:10 Changed 15 years ago by
Keywords: | Review+ added; Review? removed |
---|
I think that the only real issue in this bug is just what the patch is addressing, other comments are "noise" coming from the default <p> that it's added to any content, not related to the pasting or insertHtml operations.
comment:11 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed with [3888].
Click here for more info about our SVN system.
comment:12 Changed 11 years ago by
Component: | General → Plugin : Paste from Word |
---|
Hi!
Could you please provide more information about the steps that should be taken to reproduce this bug?
I was trying to reproduce the problem using FF2 and everything seems to work fine.
My results:
BEFORE PASTING FROM WORD:
AFTER PASTING FROM WORD:
Maybe you are referring to the problem that a <p> tag is inserted on paste even though your configuration is set to FCKConfig.EnterMode = 'br'; . Please let us know if it is the problem that you are coping with.
Thanks