Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extractContents returns incorrect result when multiple nodes are selected #644

Closed
jswiderski opened this issue Jul 13, 2017 · 2 comments
Closed
Labels
status:confirmed An issue confirmed by the development team. support An issue reported by a commercially licensed client. type:bug A bug.
Milestone

Comments

@jswiderski
Copy link
Contributor

Are you reporting a feature or a bug?

Bug

Check if the issue is already reported

https://dev.ckeditor.com/ticket/14256

Provide detailed reproduction steps (if any)

Please try this codepen: https://codepen.io/anon/pen/MoZOPE

  1. Clear editor contents and type "This is some sample text"
  2. "This is some [sample text]" - apply marker yellow to given selection
  3. "This is [some sample text]" - apply bold to given selection
  4. "[This is some sample text]" - apply below code in browser console to given selection
var currentRange = CKEDITOR.instances.editor1.getSelection().getRanges()[0];
console.log(currentRange.extractContents().getHtml());

Expected result

This is <strong>some <span class="marker">sample text</span></strong>

Actual result

This is <strong><span class="marker">sample text</span>some </strong>

Other details

  • Browser: Any
  • OS: Any
  • CKEditor version: CKEditor 4.5.0+
  • Installed CKEditor plugins: N/A
@jswiderski jswiderski added status:confirmed An issue confirmed by the development team. support An issue reported by a commercially licensed client. labels Jul 13, 2017
@mlewand mlewand added this to the Backlog milestone Jul 13, 2017
@mlewand mlewand added the type:bug A bug. label Jul 13, 2017
@msamsel msamsel self-assigned this Jul 21, 2017
@mlewand mlewand modified the milestones: 4.7.2, Backlog Jul 24, 2017
@mlewand mlewand changed the title extractContents returns incorrect result when multiple nodes are selected. extractContents returns incorrect result when multiple nodes are selected Jul 28, 2017
@jswiderski jswiderski added status:confirmed An issue confirmed by the development team. and removed status:confirmed An issue confirmed by the development team. labels Jul 31, 2017
@Comandeer
Copy link
Member

It seems that this fix eliminates also pretty nasty bug in lists.

@mlewand
Copy link
Contributor

mlewand commented Aug 16, 2017

It seems that this fix eliminates also pretty nasty bug in lists.

It has improved this TC partially but it does not fix it yet. I'll post it as a separate issue on GH.

Edit: Extracted to #790.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:confirmed An issue confirmed by the development team. support An issue reported by a commercially licensed client. type:bug A bug.
Projects
None yet
Development

No branches or pull requests

4 participants