Skip to content

Some specific emojis inside headings are not being properly linked; it should be escaped instead of beign replaced with "-" #57

Description

@guesant

Hello! Thank you for this project!

I've been trying for my README and it's a candy solution. There is an issue when dealing with specific emojis (with Github output).

tldr: emojis with variation selector is linked to github with encodeURIComponent instead of being replaced with "-"

image

emojiUnicode came from https://www.npmjs.com/package/emoji-unicode

image

image


notes about research

First, the extension MarkdownLint that I have in my vscode was warning about a dead link.

image

Later, I tried to click on Github and nothing happened for that specific link with the emoji "⚖️".

image

image

But as you can see in the previous images, this specific emoji is linked by Github as encodeURIComponent instead of just stripping with "-".

Doing some research, I noticed that this emoji is a composed one:

image

Later, I discovered something about "variant selectors":

In Unicode the value U+FE0F is called a variation selector. The variation selector in the case of emoji is to tell the system rendering the character how it should treat the value. That is, whether it should be treated as text, or as an image which could have additional properties, like color or animation.

For emoji there are two different variation selectors that can be applied, U+FE0E and U+FE0F. U+FE0E specifies that the emoji should be presented like text. U+FE0F specifies that it should be presented as an image, with color and possible animation.

Without the variation selector the character still renders fine, (just look at the page source at this character: ☁) but there's no additional information about presentation.

Source: https://stackoverflow.com/a/38100803 - by https://stackoverflow.com/users/5240004/theb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions