Opened 3 years ago

Closed 17 months ago

#16813 closed Bug (fixed)

editor.getSelectedHtml returns incorrect data

Reported by: DmitryKrekota Owned by:
Priority: Normal Milestone:
Component: Core : Selection Version: 4.7.2
Keywords: Firefox Webkit Cc:

Description

Because of clipboard plugin use editor.getSelectedHtml, this bug can reproduce with copy/paste. I also created plugin "bugdemo" to show how to repriduce the bug. You can download ckeditor with plugin "bugdemo" here: https://drive.google.com/file/d/0Bxtv10NlSOEbenRvWUtJeGhqV2c/view?usp=sharing Also, see vidio record with bug reproducing: https://drive.google.com/file/d/0Bxtv10NlSOEbVU9POE9RenZkblE/view


Steps to reproduce ("clipboard" plugin)

  1. download zip archive https://drive.google.com/file/d/0Bxtv10NlSOEbenRvWUtJeGhqV2c/view?usp=sharing , exstract it and open samples/index.html
  2. Select text "Lorem"
  3. Open and close any dropdown menu
  4. Copy selected text "Lorem" by clicking 'copy' button in toolbar.
  5. Paste selected text by clicking 'paste' button in toolbar. (CTRL + V)

Expected result ("clipboard" plugin)

Inserted text is "Lorem"

Actual result ("clipboard" plugin)

Inserted text is "Lorem ipsum dolor sit amet. Hello CKE" (all first text node)


Steps to reproduce (custom "bugdemo" plugin)

  1. download zip archive https://drive.google.com/file/d/0Bxtv10NlSOEbenRvWUtJeGhqV2c/view?usp=sharing , exstract it and open samples/index.html
  2. Select text "Lorem"
  3. Open and close any dropdown menu
  4. Click 'owl' button in toolbar.

Expected result (custom "bugdemo" plugin)

See text "~Lorem~"

Actual result (custom "bugdemo" plugin)

See text "~Lorem ipsum dolor sit amet. Hello CKE~"


Other details (browser, OS, CKEditor version, installed plugins)

Reproduced only in CKEditor Inline Editing.

Environment: Windows 7, Chrome 56.

Attachments (1)

ckeditor_bug_example.rar (1.4 MB) - added by DmitryKrekota 3 years ago.

Download all attachments as: .zip

Change History (6)

Changed 3 years ago by DmitryKrekota

Attachment: ckeditor_bug_example.rar added

comment:1 Changed 3 years ago by DmitryKrekota

My pull request for fix the bug: https://github.com/ckeditor/ckeditor-dev/pull/316

comment:2 Changed 3 years ago by Jakub Ś

Keywords: Firefox Webkit added; getSelectedHtml Selection removed
Status: newconfirmed
Version: 4.6.24.5.0

Problem can be reproduced in Firefox and Webkit browsers. IE and Edge work fine.

I was able to reproduce it with block, inline elements and plain text (ok, it is inside P by default). Basically you need to:

  1. Press New Page to clear editor contents.
  2. Type few words and select first one with mouse
  3. Click on dropdown to open it and close it with escape
  4. Press Ctrl+C/Ctrl+V

Result: whole text will be pasted.

Last edited 3 years ago by Jakub Ś (previous) (diff)

comment:3 Changed 3 years ago by DmitryKrekota

Last edited 3 years ago by DmitryKrekota (previous) (diff)

comment:4 Changed 3 years ago by Marek Lewandowski

@DmitryKrekota thanks for update, we're currently under heavy load thus having little time to go through PRs. We'll surely review it as soon as get back to PRs.

comment:5 Changed 17 months ago by Marek Lewandowski

Resolution: fixed
Status: confirmedclosed
Version: 4.5.04.7.2

This issue has been fixed in CKEditor 4.7.2, see https://github.com/ckeditor/ckeditor-dev/pull/316#issuecomment-407010594.

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