table icon indicating copy to clipboard operation
table copied to clipboard

emoji cause table column width corruption

Open unjello opened this issue 6 years ago • 6 comments

Emojis in cell text cause column width corruption:

corrupted table

stringWidth for ie. 24.2⚠️ returns 6. I am not Unicode expert, but this is most likely related to ZWJ code points and issue in string-width dependency: https://github.com/sindresorhus/string-width/issues/2. Since that issue is almost 2 years old, maybe a different module should be used or own approach implemented?

unjello avatar May 09 '18 18:05 unjello

so, done?

lvleihere avatar Jan 28 '19 03:01 lvleihere

Emojis in cell text cause column width corruption:

corrupted table

stringWidth for ie. 24.2⚠️ returns 6. I am not Unicode expert, but this is most likely related to ZWJ code points and issue in string-width dependency: sindresorhus/string-width#2. Since that issue is almost 2 years old, maybe a different module should be used or own approach implemented?

woo ~ I have the same problem. How did you solve it ?

lvleihere avatar Jan 28 '19 03:01 lvleihere

I just encountered this issue – ℹ️ and 🔥 are treated as different widths. I had them in different rows, same column.

tklovett avatar Nov 26 '19 23:11 tklovett

This issue is dependent on https://github.com/sindresorhus/string-width/issues/2

We can switch packages if there is a better alternative.

gajus avatar Nov 26 '19 23:11 gajus

what about power-assert-util-string-width?

cruzdanilo avatar Oct 02 '20 00:10 cruzdanilo

The issue seems to have been fixed a while ago in https://github.com/sindresorhus/string-width/pull/39 Would it be possible to update the dependency on this lib in table?

WaldoJeffers avatar Nov 27 '23 14:11 WaldoJeffers