Skip to content

svelte 5 : Attribute values containing {...} must be enclosed in quote marks, unless the value only contains the expression #12466

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

Closed
zhihengGet opened this issue Jul 17, 2024 · 0 comments · Fixed by #12471
Assignees

Comments

@zhihengGet
Copy link

Describe the bug

Attribute values containing {...} must be enclosed in quote marks, unless the value only contains the expression

when we have comment in handler, it errorrs

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACo2OTQ6CMBCFrzKZuAAlQXSHQOI5rAusQ9IIU0KnJqbp3U1h4dblfG_eT8DBjOSwvgXkfiKs8TrPWKB85nS4N41CWKCzftGJNE4vZpZOsZKRBLT1LNDCzkkvlB3zi-KkDZ61GMtgWC80EUuWQ0iKks1zaKG6bKDcA1Sn86k6w75MKCpuyl8TNw8vYhks69HoVxuyvO3-TItxHbsaXQ1h_V8LttAOC5zs0wyGnljL4ine4xdIOcThGQEAAA==

Logs

No response

System Info

windows

Severity

annoyance

@dummdidumm dummdidumm added this to the 5.0 milestone Jul 17, 2024
@dummdidumm dummdidumm self-assigned this Jul 17, 2024
dummdidumm added a commit that referenced this issue Jul 17, 2024
Trailing comments were added even if they started before the node end, which violates the definition of trailing comments.
This fixes that, with the consequence that some comments no longer show up in the AST at all. Previously they were stuffed _somewhere_, but arguably at the wrong positions. For example the last comment in a function body got assigned as a trailing comma for the body, which is wrong, because the body ends _after_ the comma.
The special case is comments at the end of an expression tag - they are added even if there are multiple, and they are added regardless of whether they are separated by newlines or not. This ensures the expression tag end is calculated correctly.

Fixes #12466
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 a pull request may close this issue.

2 participants