withastro / compiler

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

fix(tsx): Collect multibytes characters in skipped script and styles #1033

Closed Princesseuh closed 3 months ago

Princesseuh commented 3 months ago

Changes

When I added the ability to skip script and styles, I forgot to take into account that we should still collect the multibytes characters inside of them as we use it to adjust the positions of tags

Additionally, this PR fixes the order in which the end positions are collected, previously we'd collect it before it got adjusted after printing, which lead to the end positions being wrong most of the time. This didn't end up being a problem in the editor tooling, as we don't care too much about end positions (we map from the start position)

Testing

Added a test and updated the tests for the end positions fixes

Docs

N/A

changeset-bot[bot] commented 3 months ago

🦋 Changeset detected

Latest commit: 40ded6f7917bbc2fa2e7e6ea9064e3ce9f8e56cc

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