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

Automatically render emoji at appropriate sizes #72

Open
marcuswhybrow opened this issue May 2, 2024 · 1 comment
Open

Automatically render emoji at appropriate sizes #72

marcuswhybrow opened this issue May 2, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@marcuswhybrow
Copy link
Owner

marcuswhybrow commented May 2, 2024

In ./assets/2023-11-17-tribute-to-dr-raymond-peat.md I used a bunch of emojis. To get the right size relative to the text I used markdown's HTML passthrough to wrap each emoji in a div and individually size them.

This appraoch is verbose and repetative, but that's fine for unique problems. However, emoji's are nice to have, and a little work to do this automatically would go a long way.

Goldmark could automatically detect emojis in the markdown source, and automatically wrap each emoji in HTML to become the correct size. I found two sizes useful.

  1. An mid-paragraph emoji should be around 1.5 times the normal font size.
  2. Emoji only paragraphs should be 5 times the normal text size.
@marcuswhybrow marcuswhybrow added the enhancement New feature or request label May 2, 2024
@marcuswhybrow
Copy link
Owner Author

GoMoji looks useful.

  • It has FindAll which returns a slice containing details about each emoji found in a string.
  • And it has ReplaceEmojisWithFunc which we could use to wrap emoji's with custom HTML.

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

No branches or pull requests

1 participant