Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchor name can invalidly include spaces #5305

Closed
CharlesBelov opened this issue Aug 3, 2022 · 5 comments · Fixed by #5362
Closed

Anchor name can invalidly include spaces #5305

CharlesBelov opened this issue Aug 3, 2022 · 5 comments · Fixed by #5362
Assignees
Labels
plugin:link The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. type:bug A bug.
Milestone

Comments

@CharlesBelov
Copy link

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Start with CodePen https://codepen.io/karoldawidziuk/pen/LYzJvdx.
  2. Select "Please find below the full schedule of the event."
  3. Copy that string of text.
  4. Click the Anchor icon.
  5. In the Anchor Name field, paste the entire string of text.
  6. Click OK.

Expected result

Option 1. Get error message that the anchor name includes whitespace.
Option 2. Continue here and see option 2 expected result below.

Actual result

Continue here without error message.

Reproduction steps continued

  1. Scroll to top of edit area
  2. Select the words "The Flavorful Tuscany Meetup"
  3. Click the link icon
  4. Change Link type to Link to anchor in the text
  5. Click the down arrow in the By Element ID dropdown

Expected result

Option 2: See dropdown item "Please_find_below_the_full_schedule_of_the_event." or "Pleasefindbelowthefullscheduleoftheevent."

Actual result

See dropdown item "Please find below the full schedule of the event."

Other details

When specified on HTML elements, the id attribute value must be unique amongst all the IDs in the element’s tree and must contain at least one character. The value must not contain any space characters.

@CharlesBelov CharlesBelov added the type:bug A bug. label Aug 3, 2022
@CharlesBelov
Copy link
Author

The cited spec forbids the following characters in an id attribute:

  • U+0020 SPACE,
  • U+0009 CHARACTER TABULATION (tab),
  • U+000A LINE FEED (LF),
  • U+000C FORM FEED (FF), and
  • U+000D CARRIAGE RETURN (CR).

Therefore any of these using in the Anchor Name field need to be stripped or replaced with a permitted character.

@Comandeer
Copy link
Member

I can confirm the issue.

@Comandeer Comandeer added status:confirmed An issue confirmed by the development team. plugin:link The plugin which probably causes the issue. labels Aug 4, 2022
@jacekbogdanski
Copy link
Member

We can resolve that issue by adding validation to the anchor dialog that it's not possible to add IDs with spaces.

@sculpt0r
Copy link
Contributor

Worth to check: #1666

@CKEditorBot
Copy link
Collaborator

Closed in #5362

@CKEditorBot CKEditorBot added this to the 4.20.1 milestone Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin:link The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. type:bug A bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants