-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 unquoted slash in attributes #14615
Conversation
🦋 Changeset detectedLatest commit: ea9d4cf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
preview: https://svelte-dev-git-preview-svelte-14615-svelte.vercel.app/ this is an automated message |
|
Thank you — this fails with |
Hi, please let me know if this fixes the issue. Thanks! |
perfect, thank you! |
This pull request introduces the ability to allow unquoted slashes in attributes within the Svelte compiler. The key changes include modifications to the parser to handle unquoted slashes, as well as updates to the test cases to ensure this new feature is properly validated.
Changes to the Svelte compiler:
packages/svelte/src/compiler/phases/1-parse/state/element.js
: Modified theread_attribute
function to handle unquoted slashes in attribute values. When it's an unquoted slash, parser will handle it as a quoted slash.Updates to test cases:
packages/svelte/tests/parser-legacy/samples/attribute-unquoted/input.svelte
: Added a new test case for an anchor tag with an unquoted slash in thehref
attribute.packages/svelte/tests/parser-legacy/samples/attribute-unquoted/output.json
: Updated the expected output JSON to reflect the new test case and ensure the parser correctly handles the unquoted slash. [1] [2]Documentation:
.changeset/long-boxes-flow.md
: Added a changeset entry to document the new feature allowing unquoted slashes in attributes.Issues Related:
#7782