Closed in-the-trees closed 1 month ago
This is fantastic, thank you. I'll be looking at this in the coming week and give it a test my end and will merge in.
Excellent, thanks @in-the-trees!
Thanks again @in-the-trees, all merged in. I will look at the prettier file — we don't use it.
This fix is in version 3.2.7 which I just submitted to Apple.
Because emojis are technically multiple characters, the previous split method had the potential to break the rendering of them. I noticed this issue when viewing this profile:
To fix this, I matched the emojis with regex using Unicode's "EBNF rules". I ultimately got the pattern from this StackOverflow answer.
This was a lot trickier to fix than I expected it to be — it seems JavaScript isn't well prepared to handle this edge case. There are a number of libraries that solve this, but I figured solving this without depending on a library would be best.
Here's what my fix looks like:
I went through a number of others' profiles to ensure that the truncation still behaves as expected. As far as I saw, it does.
Also, is Prettier used for this app? My editor was picking up on the .prettierrc.js file in this repo, but it seems the files aren't formatted using it.