WordPress.org

Making WordPress.org

Opened 3 years ago

Closed 22 months ago

Last modified 22 months ago

#3838 closed defect (fixed)

Editing Descriptions that contain emoji's strip the emoji

Reported by: garrett-eclipse Owned by: dd32
Milestone: Priority: normal
Component: Trac Keywords:
Cc:

Description (last modified by dd32)

Hello,

As @SergeyBiryukov found here - https://core.trac.wordpress.org/ticket/44987#comment:3

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

Example - https://core.trac.wordpress.org/ticket/43354

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.

Cheers


✅👍🎉

Attachments (2)

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

Download all attachments as: .zip

Change History (10)

@garrett-eclipse
3 years ago

Same ticket with stripped emoji

#1 @ocean90
22 months ago

#4515 was marked as a duplicate.

#2 @dd32
22 months 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
22 months 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
22 months 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
22 months ago

  • Description modified (diff)

Just adding some Emoji ✅👍🎉 (and edited this comment to make sure editing emoji comments also works)

Last edited 22 months ago by dd32 (previous) (diff)

#6 @dd32
22 months ago

  • Description modified (diff)

and editing the Description with Emoji

#7 @garrett-eclipse
22 months ago

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

#8 @dd32
22 months 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.