Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#3838 closed defect (bug) (fixed)

Editing Descriptions that contain emoji's strip the emoji

Reported by: garrett-eclipse's profile garrett-eclipse Owned by: dd32's profile dd32
Milestone: Priority: normal
Component: Trac Keywords:

Description (last modified by dd32)


As @SergeyBiryukov found here -

The emoji's within Trac Ticket descriptions get stripped from the description edit field.

Example -

To reproduce without muddying the ticket simply put your cursor in the description field and wait for the JS to reload the ticket contents and you'll find the emoji stripped. Or if you just look in the description field you'll find no characters within it representing the emoji.



Attachments (2)

Screen Shot 2018-09-26 at 2.03.30 PM.png (121.6 KB) - added by garrett-eclipse 6 years ago.
Ticket w/ Emoji
Screen Shot 2018-09-26 at 2.03.20 PM.png (152.8 KB) - added by garrett-eclipse 6 years ago.
Same ticket with stripped emoji

Download all attachments as: .zip

Change History (10)

6 years ago

Same ticket with stripped emoji

#1 @ocean90
5 years ago

#4515 was marked as a duplicate.

#2 @dd32
5 years ago

Turns out that this isn't even a Trac bug, it's a combination Twemoji or WordPress Emoji issue.

The tl;dr of it is, the WordPress Emoji MutationObserver calls twemoji.parse() with a textarea node, which causes twemoji.grabAllTextNodes() to fetch all the subnodes of a textarea node, and not skip textarea as it "should".

I'm debating on if it's a twemoji or WordPress Emoji bug (leaning towards the latter) as I think twemoji is doing exactly what is wanted, processing Emoji's within an element that's usually skipped but doing so because it's been told to process that exact node.
On the other hand, maybe it's unexpected that passing a skipped node to twemoji.parse() should process it..

#3 @dd32
5 years ago

  • Owner set to dd32
  • Status changed from new to accepted

After chatting with Gary, I decided to just add the wp-exclude-emoji class to the textareas in Trac, I have a WIP patch for that.. but it needs some more testing

#4 @dd32
5 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 9022:

Trac: Add the wp-exclude-emoji class to the ticket description and comment textareas to avoid WordPress emoji converting emoji's to <img> which strips them from the textarea.

Fixes #3838.

#5 @dd32
5 years ago

  • Description modified (diff)

Just adding some Emoji ✅👍🎉

Version 0, edited 5 years ago by dd32 (next)

#6 @dd32
5 years ago

  • Description modified (diff)

and editing the Description with Emoji

#7 @garrett-eclipse
5 years ago

Thanks @dd32 seems to work nicely on core Trac as well.

#8 @dd32
5 years ago

In 9023:

Trac: Update the WordPress Emoji code to the latest version.
This also upgrades to using Twemoji v12 rather than v11.2.

See #3838.

Note: See TracTickets for help on using tickets.