Opened 16 years ago

Closed 13 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

  1. Using MacOS/Safari3, go to the demo page at http://www.fckeditor.net/demo
  2. Apply a H1 style to the only line
  3. Place the cursor at the end of the line and press Enter
  4. Copy any contents from the first line to the buffer
  5. Place the cursor on the second line and paste

The source now contains the infamous <span class="Apple-style-span"> tag.

RANDOM COMMENTS

  1. It does not occur if the configuration parameter ForceAsPlainText is set to true
  2. Otherwise, it seems to happen regardless of the pasting method (paste button/keyboard shortcut, direct paste/paste dialog/paste from word dialog)
  3. Tested with FCKeditor 2.5 and 2.6. I have not tried other versions
  4. 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
  1. 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 16 years ago by Artur Formella

Component: GeneralCore : Output Data
Keywords: Confirmed added
Milestone: Safari Compatibility

comment:2 Changed 15 years ago by Artur Formella

The same bug occurs in V3 (changeset 3667, safari 4).

comment:3 Changed 15 years ago by Garry Yao

Component: Core : Output DataCore : Styles
Milestone: Safari CompatibilityCKEditor 3.x

It's the way how 'contentEditable' works in Webkit,we should be able to strip it out.

comment:4 Changed 15 years ago by Frederico Caldeira Knabben

Keywords: Safari added

comment:5 Changed 14 years ago by Garry Yao

Version: FCKeditor 2.5SVN (CKEditor)

Trunk affected.

comment:6 Changed 14 years ago by Wiktor Walc

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 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.xCKEditor 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 14 years ago by Garry Yao

Milestone: CKEditor 3.3CKEditor 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:9 Changed 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.x

Milestone CKEditor 3.x deleted

comment:10 Changed 13 years ago by Wiktor Walc

Version: SVN (CKEditor) - OLD3.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>
	&nbsp;</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>
	&nbsp;</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 13 years ago by Wiktor Walc

Resolution: fixed
Status: confirmedclosed

The issue descibred in original TC was fixed with [6143]. TC from the last comment moved into a separate ticket: #7146

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy