jekyll/jemoji

update from 0.9.0 to 0.10.0 breaks emojis

rriemann opened this issue · 3 comments

I updated the gems of my Jamstack website and found out that 0.10.0 is the gem that breaks eventually the emojis.

Actual result:

The website contains :bike:

Expected result:

The website contains 🚲 (as emoji)

Have a look here: https://github.com/rriemann/blog.riemann.cc/commit/7c3efdb4b3d7837855e10a0480296d3653745bba

The next commit reverts the jemoji update to make emojis working again.

Unfortunately, I cannot provide at the moment a minimal not-working example. I use a proprietary gem in my setup.

Edit:

https://5b444c09fdd72a6adce6dbfd--blog-riemann.netlify.com/digitalisation/2018/06/06/open-letter-call-for-a-collaborative-data-protection-faq/

The table in the link above (output of the linked commit) should have plenty country flag emojis.

parkr commented

Could it be #74 that broke it, perhaps?

@parkr Yeah, #74 is a culprit. Local tests show that the bug could be due the regex involved in

jemoji/lib/jemoji.rb

Lines 84 to 85 in 173a17b

head, opener, tail = doc.output.partition(OPENING_BODY_TAG_REGEX)
body_content, *rest = tail.partition("</body>")

OPENING_BODY_TAG_REGEX = %r!<body(.*)>\s*!

Debugging in progress.. Feedback welcome.

The bug has been successfully isolated. Opening a pull request shortly..