advanced-tables-obsidian icon indicating copy to clipboard operation
advanced-tables-obsidian copied to clipboard

Characters with emoji presentation selectors swallow spaces

Open ashemedai opened this issue 2 years ago • 0 comments

Describe the bug Using certain characters with an emoji presentation selector swallow a space in the layout, leading to cells to the right being offset by 1 space to the left for every such character in a cell.

To Reproduce Steps to reproduce the behavior:

  1. Create a table
  2. Add a character like ♂️ to a cell
  3. Watch the cell gets trimmed of 1 space

Expected behavior Spacing remained the same.

Screenshots image

Desktop (please complete the following information):

  • OS: Windows 10
  • Obsidian Version: 0.14.6
  • Advanced Tables Version: 0.17.3

Additional context Many characters in Unicode can be followed by a U+FE0F character to select an emoji representation of said character. Compare ♂ (U+2642) with ♂️ (U+2642 U+FE0F). This will probably not show up properly on GitHub's render, which seems to append U+FE0F even to normal characters. You can get an easy emoji sequence from emojipedia. The screenshot should make the difference clear between the two (first row with male sign containing the emoji selector, row after it without). I guess the U+FE0F might be taken on its own and figured to have a width of its own, thus decreasing the spacing count.

Edit: Ah, you can tell there's an additional zero-width character present when you put your cursor after the character in question and press backspace. Need to press twice to delete the character.

ashemedai avatar Apr 27 '22 08:04 ashemedai