Making WordPress.org

Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#3838 closed defect (bug) (fixed)

Editing Descriptions that contain emoji's strip the emoji — at Version 6

Reported by: garrett-eclipse's profile garrett-eclipse Owned by: dd32's profile 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


✅👍🎉

Change History (8)

@garrett-eclipse
7 years ago

Same ticket with stripped emoji

#1 @ocean90
6 years ago

#4515 was marked as a duplicate.

#2 @dd32
6 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
6 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
6 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
6 years ago

  • Description modified (diff)

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

Last edited 6 years ago by dd32 (previous) (diff)

#6 @dd32
6 years ago

  • Description modified (diff)

and editing the Description with Emoji

Note: See TracTickets for help on using tickets.