dotcypress / runes

✂️ Unicode-aware JS string splitting
MIT License
226 stars 13 forks source link

subdivision-flag doesn't split well #3

Open sangar82 opened 6 years ago

sangar82 commented 6 years ago

Thanks for this excellent package!

I've found some new emojis doesn't split well https://unicode.org/emoji/charts/full-emoji-list.html#subdivision-flag Example: wales flags splits to: (7) ["🏴", "󠁧", "󠁢", "󠁷", "󠁬", "󠁳", "󠁿"]

zedryas commented 5 years ago

Hello,

While looking at those new regional flags I've noticed they follow this sequence: 0x1F3F4 // Black Flag 0xE0067 // Tag Latin Small Letter G 0xE0062 // Tag Latin Small Letter B ...3 specifics to the flag itself 0xE0007 // Cancel Tag

So they use 7 astral codes and string need to be advance by 14

Hope that helps