Opened 6 years ago

Closed 4 years ago

Last modified 4 years ago

#5447 closed Bug (fixed)

Anchorname with a blank at the end

Reported by: crosscut Owned by: garry.yao
Priority: Normal Milestone: CKEditor 3.6.4
Component: UI : Dialogs Version: 3.0
Keywords: Confirmed, IBM Cc: monahant@…

Description

A Link doesnt jump to an anchor which name ends with a blank. Only tested with the ckeditor vers. 3.2.5205 and firefox vers 3.6.3.

Attachments (2)

5447.patch (503 bytes) - added by garry.yao 6 years ago.
5447_2.patch (392 bytes) - added by tmonahan 4 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 6 years ago by alfonsoml

  • Keywords Confirmed added
  • Milestone set to CKEditor 3.4

The anchor dialog should validate that the provided anchor name is valid

Changed 6 years ago by garry.yao

comment:2 Changed 6 years ago by garry.yao

  • Component changed from General to UI : Dialogs
  • Keywords Review? added
  • Owner set to garry.yao
  • Status changed from new to assigned
  • Version set to 3.0

comment:3 Changed 6 years ago by alfonsoml

The patch doesn't allow a single letter name, but I think that it should be valid. Also, as we aren't interested in the details it should be enough to use test instead of match:

if ( !(/^[A-Za-z][-A-Za-z0-9_:.]*$/.this.getValue())  )

(untested)

comment:4 follow-up: Changed 6 years ago by fredck

  • Keywords Review- added; Review? removed
  • Milestone CKEditor 3.4 deleted

The provided patch will show the "Please type the anchor name" message in this case, and the user will get confused.

Let's simply trim the spaces from the name, as users may not notice that they are there, being again confused.

If validation is to be done, other than trimming, a dedicated error message should be displayed. This is not a requirement for this ticket though.

comment:5 in reply to: ↑ 4 Changed 4 years ago by tmonahan

  • Cc monahant@… added
  • Keywords IBM added

As per comment:4, I believe trimming the spaces would be enough here. See proposed solution in the attached patch.

Changed 4 years ago by tmonahan

comment:6 Changed 4 years ago by garry.yao

  • Status changed from review_failed to review_passed

comment:7 Changed 4 years ago by garry.yao

  • Resolution set to fixed
  • Status changed from review_passed to closed

Fixed with [7507].

comment:8 Changed 4 years ago by tmonahan

The provided fix does not seem like a good solution for this. With this fix, if the user includes spaces at the end of their anchor name, they get prompted with the message 'Please type the anchor name'. This is confusing for the user as they do not know what is wrong with the name they have already entered.

A better approach would be to trim the anchor name before it is committed as proposed in 5447_2.patch.

comment:9 Changed 4 years ago by garry.yao

Sorry, wrong patch committed, re-fixed with [7514].

comment:10 Changed 4 years ago by fredck

  • Milestone set to CKEditor 3.6.4
Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy