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

Emoji are rendered inside Markdown code blocks #876

Open
zoriya opened this issue May 10, 2024 · 2 comments
Open

Emoji are rendered inside Markdown code blocks #876

zoriya opened this issue May 10, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@zoriya
Copy link

zoriya commented May 10, 2024

Issue description

Using code blog inside markdown content files do not escape emoji conversion.

For example: ffmpeg -map 0:a:0 converts :a: to 🅰️

This is because hugo's emojify transform does not know about markdown code blogs, it was fixed on hugo's side by disabling their internal emojify transform and using the markdown's renderer one (see gohugoio/hugo#4978 for more info).

Please note that disabling hugo's emojify is not possible (to my knowledge) since congo hardcodes | emojify calls everywhere. This means the config option enableEmoji = false does nothing.

Theme version

v2.8.2

Hugo version

hugo v0.124.1+extended linux/amd64 BuildDate=unknown VendorInfo=nixpkgs

Which browser rendering engines are you seeing the problem on?

Chromium (Google Chrome, Microsoft Edge, Brave, Vivaldi, Opera, etc.), Firefox (Mozilla Firefox), WebKit (Safari)

URL to sample repository or website

No response

Hugo output or build error messages

No response

@zoriya zoriya added the bug Something isn't working label May 10, 2024
@jpanther
Copy link
Owner

I don't believe this is an issue with Congo as this is the expected behaviour of Hugo's markdown parser. Have you tried this Hugo configuration?

enableEmoji = false

[markup.goldmark.extensions]
emoji = true

@jpanther jpanther changed the title Emoji are rendered inside code blogs Emoji are rendered inside Markdown code blocks Aug 29, 2024
@zoriya
Copy link
Author

zoriya commented Aug 29, 2024

Yes I did. The issue comes from the | emojify inside Congo's source code. Those pipes don't read the configuration and use the builtin emoji parser that doesn't understand emoji.

The fix is to remove the emojify pipe everywhere markdown content is expected and let glowfish handle emoji for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants