mity / md4c

C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.
MIT License
756 stars 138 forks source link

feature idea: named emoji like `:wink:` #183

Open ec1oud opened 1 year ago

ec1oud commented 1 year ago

Here's a long list: https://www.webfx.com/tools/emoji-cheat-sheet/ (GitHub handles these: :guitar: )

One way would be for md4c to simply detect :word_sequence: syntax and give us a span like MD_SPAN_SYMBOL or so; the user of the library could do whatever is needed to translate those names to glyphs.

Another way is to actually make the Unicode substitutions inline with no span, as if the author had typed a Unicode symbol in the markdown file. But that would add some bloat (a table mapping names to Unicode codepoints) and also loses information: what name the markdown author was using between colons. To rewrite the same markdown, a reverse lookup would be necessary.

So I think I like the first way better: less bloat in md4c, and as extensible as the user wants.

cheungxiongwei commented 1 year ago

This looks really cool, you can provide a list of emoji symbols here

petko commented 4 months ago

You can find a full list here: https://api.github.com/emojis

Notice that each emoji contains both the emoji code and the Unicode codepoint in the URL.

For example: grinning has value of https://github.githubassets.com/images/icons/emoji/unicode/1f600.png?v8, where 1f600 is the codepoint for the 😀 emoji.

P.S.: Some emojis are combinations of more than one emoji (for example :office_worker: 🧑‍💼 is 1f468-1f4bc ) and some are for countries (for example :bulgaria: 🇧🇬 is 1f1e7-1f1ec ).