Opened 9 years ago

Closed 5 years ago

Last modified 5 years ago

#1961 closed New Feature (fixed)

generate both Id and Name for anchors

Reported by: Alfonso Martínez de Lizarrondo Owned by: Alfonso Martínez de Lizarrondo
Priority: Normal Milestone: CKEditor 3.6.5
Component: General Version: 3.0
Keywords: HasPatch Cc:


Currently the anchors do create just <a name=""> but, if also an id is automatically generated, then it can help to do dynamical effects on the page (for example clicking on a link and smoothly scroll to the anchor pointed by the link)

Some people even state that only IDs should be generated as names are just something from the past, but that's another battle.

Attachments (1)

1961.patch (405 bytes) - added by Loren 5 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 9 years ago by Wojciech Olchawa

Keywords: Confirmed added

comment:2 Changed 8 years ago by richsky

I was close to create a new ticket. But I think this it important. As soon as you have an HTML page with anchor identified by ids and not by "name", they don't appear.

I would like the anchor to be available and editable by "ids".

comment:3 Changed 6 years ago by Anna Tomanek

I second this request.

Please note that HTML5 will only support "id" for an <a> element. Moreover, when scrolling to a fragment identifier HTML5 will first look for an element with a given "id" and only then try to find the <a> element with a matching "name" attribute.

comment:4 Changed 5 years ago by Fabian Vogelsteller

i would like to see this feature too.. adding both name and id.

Changed 5 years ago by Loren

Attachment: 1961.patch added

comment:5 Changed 5 years ago by Loren

Keywords: HasPatch added

Patch attached

comment:6 Changed 5 years ago by Loren

Component: GeneralUI : Dialogs
Version: 3.6.5 (SVN - trunk)

comment:7 Changed 5 years ago by Jakub Ś

Component: UI : DialogsGeneral
Version: 3.6.5 (SVN - trunk)3.0

@wiseloren field version is used to indicate when problem first occurred. Please don't change it.

comment:8 Changed 5 years ago by Loren

Sorry about that good to know. I was thinking it would be the version the patch was made for.

comment:9 Changed 5 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.6.5
Resolution: fixed
Status: confirmedclosed

Fixed with [7618].

comment:10 Changed 5 years ago by sean

I'd like to report that having BOTH name and id breaks PHP's DOMDocument::loadHTML().

The answer here explains that:

I've made my own link plugin that patch reverted, which works well.

comment:11 Changed 5 years ago by Jakub Ś

But this is allowed in HTML. Even Link you have given says that HTML spec. allows it. There is o error in HTML and CKEditor but in PHP.

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