withastro / compiler

The Astro compiler. Written in Go. Distributed as WASM.
Other
503 stars 59 forks source link

fix(tokenizer): handle unterminated quoted attributes gracefully #923

Closed MoustaphaDev closed 11 months ago

MoustaphaDev commented 11 months ago

Changes

Fix an issue where unterminated quoted attributes caused the compiler to crash

Testing

Added a TSX output test to make sure the compiler doesn't crash

Docs

N/A bug fix

changeset-bot[bot] commented 11 months ago

🦋 Changeset detected

Latest commit: 1e8453aa6551dbe51d5ccfd279497ab0f914820f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ----------------- | ----- | | @astrojs/compiler | Patch |

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

Princesseuh commented 11 months ago

The crash only happened in the AST printing. Could a test be added for that too?

MoustaphaDev commented 11 months ago

Sure, I'll add that

MoustaphaDev commented 11 months ago

!preview jsx-attr-issue

github-actions[bot] commented 11 months ago
 > root@0.0.0 release /home/runner/work/compiler/compiler > changeset publish "--tag" "next--jsx-attr-issue" 🦋 warn ===============================IMPORTANT!=============================== 🦋 warn Packages will be released under the next--jsx-attr-issue tag 🦋 warn ---------------------------------------------------------------------- 🦋 info npm info @astrojs/compiler 🦋 info @astrojs/compiler is being published because our local version (0.0.0-jsx-attr-issue-20231224202721) has not been published on npm 🦋 info Publishing "@astrojs/compiler" at "0.0.0-jsx-attr-issue-20231224202721" 🦋 success packages published successfully: 🦋 @astrojs/compiler@0.0.0-jsx-attr-issue-20231224202721 🦋 Creating git tag... 🦋 New tag: @astrojs/compiler@0.0.0-jsx-attr-issue-20231224202721
MoustaphaDev commented 11 months ago

I'm not at my desk right now, I'll fix the failing tests a bit later today (probably impacted by the recent merged PRs)

MoustaphaDev commented 11 months ago

Tests should pass after merging https://github.com/withastro/compiler/pull/932