Opened 13 years ago
Closed 10 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 |
Description
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:
- Add the following HTML to the editor through source mode:
<p> Sample text <a href="http://ckeditor.com"><strong>Anchor </strong></a>more text</p>
- Switch back to wysiwyg mode and select the entire editor contents.
- Click the Link icon on the toolbar and enter a url for the selection e.g. www.ibm.com. Click OK.
- 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)
Change History (3)
Changed 13 years ago by
Attachment: | Nested Anchor Issue.gif added |
---|
comment:1 Changed 13 years ago by
Status: | new → confirmed |
---|---|
Version: | 3.6.2 (SVN - trunk) → 3.0 |
comment:2 Changed 10 years ago by
Resolution: | → duplicate |
---|---|
Status: | confirmed → closed |
DUP of #8097. The problem with strong will disappear after fixing the way how the link is applied.
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