Opened 7 years ago

Closed 5 years ago

Last modified 5 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 7 years ago.
5447_2.patch (392 bytes) - added by Teresa Monahan 5 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 7 years ago by Alfonso Martínez de Lizarrondo

Keywords: Confirmed added
Milestone: CKEditor 3.4

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

Changed 7 years ago by Garry Yao

Attachment: 5447.patch added

comment:2 Changed 7 years ago by Garry Yao

Component: GeneralUI : Dialogs
Keywords: Review? added
Owner: set to Garry Yao
Status: newassigned
Version: 3.0

comment:3 Changed 7 years ago by Alfonso Martínez de Lizarrondo

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 Changed 7 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed
Milestone: CKEditor 3.4

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 5 years ago by Teresa Monahan

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 5 years ago by Teresa Monahan

Attachment: 5447_2.patch added

comment:6 Changed 5 years ago by Garry Yao

Status: review_failedreview_passed

comment:7 Changed 5 years ago by Garry Yao

Resolution: fixed
Status: review_passedclosed

Fixed with [7507].

comment:8 Changed 5 years ago by Teresa Monahan

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 5 years ago by Garry Yao

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

comment:10 Changed 5 years ago by Frederico Caldeira Knabben

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