Opened 12 years ago

Closed 9 years ago

#8368 closed Bug (duplicate)

Incorrect DOM structure after applying an anchor style to a selection that already contains a styled anchor

Reported by: Teresa Monahan Owned by:
Priority: Normal Milestone:
Component: Core : Styles Version: 3.0
Keywords: IBM Cc: Damian, Satya Minnekanti


When a selection contains an anchor that has some styling, and the user tries to apply another anchor to this selection, the DOM structure returned after applying the anchor is malformed.

To Reproduce:

  1. Add the following HTML to the editor through source mode:
    	Sample text <a href=""><strong>Anchor </strong></a>more text</p>
  2. Switch back to wysiwyg mode and select the entire editor contents.
  3. Click the Link icon on the toolbar and enter a url for the selection e.g. Click OK.
  4. Inspect the DOM for the editor contents - see the attached screen capture.

Problem: The DOM contains nested anchor nodes and an empty strong tag.

Note: Do not switch into source mode before inspecting the DOM - this corrects the DOM structure.

This issue causes problems for us in one of our extensions which needs to work with the DOM after the anchor styling is applied.

In the example above, applyInlineStyle from styles/plugin.js is used to apply the anchor to the selection. Is it possible to change the way this handles anchors in the selection to avoid this incorrect DOM structure?

Attachments (1)

Nested Anchor Issue.gif (3.9 KB) - added by Teresa Monahan 12 years ago.

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by Teresa Monahan

Attachment: Nested Anchor Issue.gif added

comment:1 Changed 12 years ago by Jakub Ś

Status: newconfirmed
Version: 3.6.2 (SVN - trunk)3.0

Looks like one <a> tag is divided into three because of this strong element inside.

Anyway the issue has been reproducible form CKE 3.0

comment:2 Changed 9 years ago by Piotrek Koszuliński

Resolution: duplicate
Status: confirmedclosed

DUP of #8097. The problem with strong will disappear after fixing the way how the link is applied.

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