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

fix: allow additional unquoted attribute values #13090

Closed
wants to merge 1 commit into from

Conversation

Pallavrai
Copy link

@Pallavrai Pallavrai commented Aug 31, 2024

Fixes #7782

Changed regex_invalid_unquoted_attribute_value with new expression which now supports = followed by / only.

Updated this particular line const regex_invalid_unquoted_attribute_value = /^(\/>|[\s"'<>]|=[^/])/;`
so that it can support html5 symbol and does not declare invalid to this Home

…th new expression which now supports = followed by / only.
Copy link

changeset-bot bot commented Aug 31, 2024

⚠️ No Changeset found

Latest commit: 15c8088

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@benmccann benmccann changed the title fixed #7782 Changed regex_invalid_unquoted_attribute_value with new expression which now supports = followed by / only. fix: allow additional unquoted attribute values Sep 6, 2024
@benmccann
Copy link
Member

Thanks for sending a PR! One tip: please put "Fixes" followed by the issue number in the PR description rather than title. This is a GitHub feature that will link the issue to the PR so that when the PR is merged the issue will be automatically closed. I've updated it for you already, but thought I'd mention it for next time

@Pallavrai
Copy link
Author

Thanks for sending a PR! One tip: please put "Fixes" followed by the issue number in the PR description rather than title. This is a GitHub feature that will link the issue to the PR so that when the PR is merged the issue will be automatically closed. I've updated it for you already, but thought I'd mention it for next time

Thanks alot 😊.

@Rich-Harris
Copy link
Member

Thank you but this doesn't work? Feel free to open a new PR with a test (which could be as simple as adding <a href=/>home</a> to https://github.com/sveltejs/svelte/blob/main/packages/svelte/tests/parser-legacy/samples/attribute-unquoted/input.svelte#L1 and updating the accompanying output.json)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(minor) unquoted slash in attributes throws "attempted to close an element that was not open"
3 participants