Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Custom emoji support #30

Open
guoyunhe opened this issue Jan 9, 2024 · 2 comments · Fixed by #31
Open

[Feature Request] Custom emoji support #30

guoyunhe opened this issue Jan 9, 2024 · 2 comments · Fixed by #31

Comments

@guoyunhe
Copy link
Contributor

guoyunhe commented Jan 9, 2024

In many forum and chat apps, you are able to create your own emojis, like

Parrot

And you can have your own short code:

:parrot:

Configuration will be like:

remark().use(emoji, {
  customEmojis: {
    parrot: '![Parrot](https://cultofthepartyparrot.com/parrots/parrot.gif)'
  }
});
@rhysd rhysd closed this as completed in #31 Apr 8, 2024
@rhysd rhysd reopened this Apr 8, 2024
@rhysd
Copy link
Owner

rhysd commented Apr 8, 2024

I reopened this issue ticket since #31 was reverted.

@rhysd
Copy link
Owner

rhysd commented Apr 8, 2024

Since remark is essentially a transformation from Markdown AST to HTML AST, it is difficult to provide APIs which allow to specify raw Markdown or HTML sources (if we do, we need to parse the sources into AST nodes in advance).

Configuration like below would be easier, but I'm not sure it is useful (since I don't have use case to provide custom emoijs).

remark().use(emoji, {
  customEmojis: {
    parrot: {
      src: 'https://cultofthepartyparrot.com/parrots/parrot.gif', // "src" of <img> (requried)
      aria: 'rainbow parrot', // aria label for accessibility (optional)
    }
  }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants