WordPress.org

Making WordPress.org

Opened 9 months ago

Last modified 32 hours ago

#3838 accepted defect

Editing Descriptions that contain emoji's strip the emoji

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

Description

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 9 months ago.
Ticket w/ Emoji
Screen Shot 2018-09-26 at 2.03.20 PM.png (152.8 KB) - added by garrett-eclipse 9 months ago.
Same ticket with stripped emoji

Download all attachments as: .zip

Change History (5)

@garrett-eclipse
9 months ago

Same ticket with stripped emoji

#1 @ocean90
2 days ago

#4515 was marked as a duplicate.

#2 @dd32
34 hours 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
32 hours 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

Note: See TracTickets for help on using tickets.