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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor regression in Emoji detection #5635

Closed
kaushalmodi opened this Issue Jan 24, 2019 · 6 comments

Comments

Projects
None yet
3 participants
@kaushalmodi
Copy link
Member

kaushalmodi commented Jan 24, 2019

Hello,

I was browsing one of my old posts when I realized that Hugo had stopped rendering :+1: as 馃憤 .

Going through the commit history, I found this recent commit: 9cd54ca#diff-2b6430ca571aa476215d342bcbb4d624R226

	if !isAlphaNumeric(r) {
			break

AFAIK all the emojis from https://www.webfx.com/tools/emoji-cheat-sheet/ are supported by the library that Hugo uses for Emoji parsing. The only failing corner cases in there, I think (haven't looked at each of those codes), are :+1: and :-1:.

Can you add + and - to the valid range of Emoji characters?

@bep bep added the Bug label Jan 24, 2019

@bep bep added this to the v0.54 milestone Jan 24, 2019

@kaushalmodi

This comment has been minimized.

Copy link
Member Author

kaushalmodi commented Jan 24, 2019

I completely missed the underscores .. because they also won't be covered by isAlphaNumeric. The underscore case itself breaks a lot of cases like :christmas_tree: (馃巹), :heart_eyes: (馃槏), etc.

@anthonyfok anthonyfok self-assigned this Jan 29, 2019

@anthonyfok

This comment has been minimized.

Copy link
Contributor

anthonyfok commented Jan 29, 2019

Actually, isAlphaNumeric in parser/pageparser/pagelexer.go does cover the underscore, so the only characters/runes missing are + and - (hyphen).

@kaushalmodi

This comment has been minimized.

Copy link
Member Author

kaushalmodi commented Jan 29, 2019

@anthonyfok Though I tested that the emojis with underscores in my earlier comment did not work.

@anthonyfok

This comment has been minimized.

Copy link
Contributor

anthonyfok commented Jan 29, 2019

@anthonyfok Though I tested that the emojis with underscores in my earlier comment did not work.

Strange... But :christmas_tree: does work for me here with Hugo 0.53.

@kaushalmodi

This comment has been minimized.

Copy link
Member Author

kaushalmodi commented Jan 29, 2019

@anthonyfok Odd. Though, thanks for fixing this! I'll rebuild Hugo later and verify.

anthonyfok added a commit that referenced this issue Jan 29, 2019

@kaushalmodi

This comment has been minimized.

Copy link
Member Author

kaushalmodi commented Jan 30, 2019

@anthonyfok I confirm this fix (emojis with _, +, -). Thank you!

@bep bep modified the milestones: v0.54, v0.53.1 Feb 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment