tools
tools copied to clipboard
🐛 Emdash crashes rome
Environment information
This also seems to happen in the playground, but happens with Rome 10.1 and React Native
What happened?
- Go to playground
- Type "<Text>Try it – <Text>7 Days</Text> for free!</Text>" (note the dash is an emdash)
- Save. Playground will go blank and rome will crash or move around text incorrectly. Playground link: https://docs.rome.tools/playground/?code=PABUAGUAeAB0AD4AVAByAHkAIABpAHQAIAATICAAUABsAGEAeQAgADwAPAAvAFQAZQB4AHQAPgA%3D
Expected result
It should just treat emdashes normally
Code of Conduct
- [X] I agree to follow Rome's Code of Conduct
There are two similar but separate issue here related to the handling of character positions in UTF-8 strings as byte offset, for Rome itself I can't reproduce the issue on the latest nightly so this was probably fixed by #3745, while for the playground the exception is thrown by CodeMirror as we provide invalid positions for the diagnostics here: https://github.com/rome/tools/blob/ce16cb8212de802b192eb8710577275e009d576f/website/src/playground/CodeMirror.tsx#L61-L62
This should be fixed