withastro / compiler

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

fix: better sourcemaps handling with multibyte characters #902

Closed MoustaphaDev closed 11 months ago

MoustaphaDev commented 12 months ago

Changes

Fix #872

The initial code inaccurately incremented start for each character iteration without considering variable byte sizes. The updated code utilizing utf8.DecodeRuneInString, correctly adjusts start based on the byte size of each character.

Testing

Added a printer test

Docs

N/A bug fix

changeset-bot[bot] commented 12 months ago

🦋 Changeset detected

Latest commit: ca54bd3fb51d3acde0cbc5cad28c11ca70ffb8d7

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

MoustaphaDev commented 11 months ago

I'll be watching closely if this causes any issue. Touching sourcemaps is scary 😆