Opened 6 years ago

Closed 6 years ago

#6588 closed Bug (fixed)

Copy and paste adds <span> if SCAYT is enabled

Reported by: DandyNZ Owned by: Saare
Priority: Normal Milestone: CKEditor 3.4.3
Component: UI : Spell Checker Version: 3.4.2
Keywords: Cc: SpellChecker.net

Description

Copying something with a 'spelling' error ( eg CKEditor ) generates extra code when it is pasted in HTML view mode with SCAYT enabled.

The source code <p>CKEditor</p> will lead to <p><span>CKEditor</span></p>.

Error consistently reproducible in Firefox 3.6.12 on Windows and Linux.

Cannot reproduce in IE8 or Chrome.

This is only an issue (for me) when wiki style links are copied and pasted. It messes with things such as [[spelling: eror]], leading to [[spelling: <span>eror</span>]]

Many thanks for your time and for CKEditor, it's awesome!

Attachments (4)

6588.patch (1.3 KB) - added by SpellChecker.net 6 years ago.
6588_2.patch (1.2 KB) - added by garry.yao 6 years ago.
6588_3.patch (1.5 KB) - added by SpellChecker.net 6 years ago.
6588_4.patch (1.5 KB) - added by Saare 6 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 6 years ago by Saare

  • Cc SpellChecker.net added
  • Component changed from General to UI : Spell Checker
  • Keywords Firefox added
  • Status changed from new to pending

I'm unable to reproduce your problem. Are you able to reproduce the bug on the samples of the SVN or the nightly build? If not, Please attach or link us to the page you're using.

comment:2 Changed 6 years ago by SpellChecker.net

  • Keywords Confirmed added

We can confirm this on ckeditor.com/demo

Steps to reproduce:

  1. Open ckeditor.com/demo
  2. Paste any text from Wikipedia with some unknown words
  3. Enable SCAYT and wait until it underlines unknow words
  4. Ctrl+A, then Ctrl+C
  5. Open ckeditor.com/demo once more, e.g. in another tab
  6. Paste copied text
  7. Go to "Source" mode

Actual result:
Misspelled words are wrapped in <span>s.

Expected result:
Source code is the same for both CKEditor tabs.

comment:3 Changed 6 years ago by Saare

  • Keywords Confirmed removed
  • Status changed from pending to confirmed

I can confirm that also on IE.

comment:4 Changed 6 years ago by garry.yao

  • Keywords Firefox removed

@SpellCheck.net First of all we have no control over clipboard data, so to help us (and browsers) to properly filtering SCAYT marker when pasting, a valid HTML attribute has to take place, e.g. class="scayt".

comment:5 Changed 6 years ago by SpellChecker.net

Yes, we plan to add some filtering to the CKEditor core module to filter <span>s with "scayt_word" or "scaytid" attributes.

Changed 6 years ago by SpellChecker.net

comment:6 Changed 6 years ago by SpellChecker.net

  • Keywords HasPatch Review? added
  • Version changed from 3.4.1 to 3.4.2

We have managed to fix this in plug-in. Here is patch. Please, review.

comment:7 Changed 6 years ago by fredck

  • Milestone set to CKEditor 3.4.3

The patch looks correct, with some code rewriting.

Changed 6 years ago by garry.yao

comment:8 Changed 6 years ago by garry.yao

  • Keywords HasPatch Review? removed
  • Owner set to garry.yao
  • Status changed from confirmed to review

comment:9 Changed 6 years ago by garry.yao

  • Status changed from review to review_failed

Sorry I'm mis-leading here, the right way of fixing this is instead prefixing all SCAYT custom attributes (e.g. scayt_word) with 'data-', check #6334 for more information.

comment:10 Changed 6 years ago by garry.yao

  • Owner garry.yao deleted
  • Status changed from review_failed to new

comment:11 Changed 6 years ago by Saare

  • Status changed from new to confirmed

comment:12 Changed 6 years ago by SpellChecker.net

  • Keywords HasPatch Review? added

We have followed your instructions and added the prefix 'data-' to all SCAYT custom attributes. In order to get it work please switch SCAYT plug-in to use SCAYT core 2.6(Ticket: #6769). Please, review.

Changed 6 years ago by SpellChecker.net

Changed 6 years ago by Saare

comment:13 Changed 6 years ago by Saare

  • Keywords Review? removed
  • Owner set to Saare
  • Status changed from confirmed to review

Making some code rewriting to your patch.

comment:14 Changed 6 years ago by garry.yao

  • Status changed from review to review_failed

There' s no need of doing data filtering, it doesn't affect wysiwyg.

comment:15 Changed 6 years ago by garry.yao

  • Keywords HasPatch removed
  • Resolution set to fixed
  • Status changed from review_failed to closed

Fixed with [6169].

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy