Opened 9 years ago

Closed 4 years ago

Last modified 4 years ago

#1961 closed New Feature (fixed)

generate both Id and Name for anchors

Reported by: alfonsoml Owned by: alfonsoml
Priority: Normal Milestone: CKEditor 3.6.5
Component: General Version: 3.0
Keywords: HasPatch Cc:

Description

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 wiseloren 4 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 9 years ago by w.olchawa

  • Keywords Confirmed added

comment:2 Changed 7 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

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 4 years ago by frozeman

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

Changed 4 years ago by wiseloren

comment:5 Changed 4 years ago by wiseloren

  • Keywords HasPatch added

Patch attached

comment:6 Changed 4 years ago by wiseloren

  • Component changed from General to UI : Dialogs
  • Version set to 3.6.5 (SVN - trunk)

comment:7 Changed 4 years ago by j.swiderski

  • Component changed from UI : Dialogs to General
  • Version changed from 3.6.5 (SVN - trunk) to 3.0

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

comment:8 Changed 4 years ago by wiseloren

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

comment:9 Changed 4 years ago by fredck

  • Milestone set to CKEditor 3.6.5
  • Resolution set to fixed
  • Status changed from confirmed to closed

Fixed with [7618].

comment:10 Changed 4 years ago by scollins

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

The answer here explains that: http://stackoverflow.com/questions/3614586/dom-error-id-someanchor-already-defined-in-entity-line

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

comment:11 Changed 4 years ago by j.swiderski

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 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy