Opened 17 years ago
Closed 14 years ago
#2178 closed Bug (fixed)
Pasting contents in Safari outputs <span class="Apple-style-span"> tags
Reported by: | Hervé BLONDEAU | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Styles | Version: | 3.0 |
Keywords: | Safari | Cc: |
Description
DESCRIPTION
Pasting contents in Safari outputs <span class="Apple-style-span"> tags.
Tested with Safari 3(3.1.1) under MacOS X(10.4.11).
HOW TO REPRODUCE
- Using MacOS/Safari3, go to the demo page at http://www.fckeditor.net/demo
- Apply a H1 style to the only line
- Place the cursor at the end of the line and press Enter
- Copy any contents from the first line to the buffer
- Place the cursor on the second line and paste
The source now contains the infamous <span class="Apple-style-span"> tag.
RANDOM COMMENTS
- It does not occur if the configuration parameter ForceAsPlainText is set to true
- Otherwise, it seems to happen regardless of the pasting method (paste button/keyboard shortcut, direct paste/paste dialog/paste from word dialog)
- Tested with FCKeditor 2.5 and 2.6. I have not tried other versions
- There have been several related tickets (52, 55, 569, 1701, 2113) dealing with this span tag issue, but I have not found any solution that could apply to the present problem:
- 52, 55, 569 were fixed with changeset 774 but this did obviously not impact this issue
- 1701 is related to another keyboard shortcut, plus it clearly states in one of the comments that META-V works as expected
- 2113 contains an interesting patch (changeset 1951) which I downloaded and installed. The patch itself "partially" solves the problem: switching to source mode displays the unwanted tags, but then switching back to preview mode and finally back to source mode again (or saving) indeed removes all those tags. However, until the user goes through all those manipulations, the tags will still be there and thus hinder some of the functions (for instance, applying a H6 format will not seem to have any effect as it will be overridden by the span).
I thought about reusing the portion of code in the modified fckdocumentprocessor.js that removes all those span tags, to apply it after each pasting operation. However I made many tests but could not find where and how to use it, as I do not understand the event/keystroke catching model well enough. Therefore I do not know whether I am on the right track or not
Thank you
Change History (11)
comment:1 Changed 17 years ago by
Component: | General → Core : Output Data |
---|---|
Keywords: | Confirmed added |
Milestone: | → Safari Compatibility |
comment:2 Changed 16 years ago by
comment:3 Changed 16 years ago by
Component: | Core : Output Data → Core : Styles |
---|---|
Milestone: | Safari Compatibility → CKEditor 3.x |
It's the way how 'contentEditable' works in Webkit,we should be able to strip it out.
comment:4 Changed 16 years ago by
Keywords: | Safari added |
---|
comment:6 Changed 15 years ago by
This is not only a problem when pasting text, sometimes when doing normal operations like applying and removing formatting or deleting a table various <span class="Apple-style-span">
tags are added.
comment:7 Changed 15 years ago by
Milestone: | CKEditor 3.x → CKEditor 3.3 |
---|
I think it's worth having a filter to cleanup <span class="Apple-style-span"> which is enabled on WebKit only.
comment:8 Changed 15 years ago by
Milestone: | CKEditor 3.3 → CKEditor 3.x |
---|
We should first well figure out when webkit's adding "Apple-style-span" and enumerate couple of test cases before doing anything else.
comment:10 Changed 14 years ago by
Version: | SVN (CKEditor) - OLD → 3.0 |
---|
The result in Safari 5.0.4 / Snow Leopard using the original TC is now different for me, heading is surrounded with a div tag.
<h1> Heading1</h1> <p> </p> <div style="font-family: Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); "> <h1> Heading1</h1> </div>
The result in Chrome 9.0.597.94 is similar, but note the extra meta tag:
<h1> Heading1</h1> <p> </p> <meta charset="utf-8" /> <div style="font-family: Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); "> <h1> Heading1</h1> </div>
The Apple-style-span class seems to be gone.
comment:11 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | confirmed → closed |
The same bug occurs in V3 (changeset 3667, safari 4).