question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should whitespace be allowed for use as an ID?

See original GitHub issue

I haven’t had the chance to check across platforms yet, but I bet that the id property is allowed to be whitespace across most (all?) platforms. Should it?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewleadercommented, Apr 25, 2019

I’d say reject all together, and enforce a strict Regex for ids.

0reactions
jonmillcommented, Nov 4, 2021

Whatever is shipped today is the supported scenario - we can’t break existing customers at this point

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should whitespace be allowed for use as an ID? #2748
I haven't had the chance to check across platforms yet, but I bet that the id property is allowed to be whitespace across...
Read more >
HTML check: An ID must not contain whitespace
Technically, in HTML5, the value for an id attribute may contain any character, except whitespace characters. However, to avoid inadvertent errors, ...
Read more >
Can a DOM element have an ID that contains a space?
Short answer is no. Letters, numbers, underscores, hyphens, periods and colons only. (darn, karim beat me to it.) Share.
Read more >
What are some compelling reasons to disallow spaces in ...
Whitespaces will only stripped in the frontend. You'll be able to drop that feature by altering only one frontend application.
Read more >
Is it bad practice to have document name with spaces?
No spaces is best practice. Upvote -2
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found