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

Allow icons with unquoted/single-quoted ids in the styleguide #11903

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

laymonage
Copy link
Member

@laymonage laymonage commented Apr 29, 2024

Fixes #11895. The HTML spec allows attributes to have no value, unquoted value, single-quoted value, and double-quoted value: https://html.spec.whatwg.org/multipage/syntax.html#attributes-2

This issue has been around since the styleguide's icon list was reimplemented as a table in 43ca8be. In the implementation, our regex only considers the most common use case (double-quoted value).

@@ -30,7 +30,7 @@ Draw or download an icon and save it in a template folder:

The `svg` tag should:

- Set the `id="icon-<name>"` attribute, icons are referenced by this name.
- Set the `id="icon-<name>"` attribute, icons are referenced by this `name`. The `name` should only contain lowercase letters, numbers, and hyphens.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this limitation only exists because of the styleguide's regex, and the icons can technically still be used elsewhere as long as the ID is prefixed with icon-. Alternatively we could update the regex to be more permissive.

Copy link

squash-labs bot commented Apr 29, 2024

Manage this branch in Squash

Test this branch here: https://laymonagefix-styleguide-icon-q-6wvk1.squash.io

@gasman
Copy link
Collaborator

gasman commented Apr 29, 2024

Bumping to 6.2, since at this point any new additions to 6.1 should only really be regressions and critical issues (to minimise the possibility of introducing new issues that haven't been tested with a release candidate).

@gasman gasman modified the milestones: 6.1, 6.2 Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🕵️ Reviewing
Development

Successfully merging this pull request may close these issues.

styleguide - custom icons with id defined with single quotes cause 500 error when loading style guide
3 participants