[wp-meta] [Making WordPress.org] #6703: Block editor prevents emojis in reviews
Making WordPress.org
noreply at wordpress.org
Fri Jan 27 22:08:40 UTC 2023
#6703: Block editor prevents emojis in reviews
----------------------------+---------------------
Reporter: Clorith | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone:
Component: Support Forums | Resolution:
Keywords: |
----------------------------+---------------------
Comment (by Clorith):
Adding additional details here as well for the sake of sharing
discoveries, but what has been found has also been shared on the Blocks
Everywhere Github repository ([https://github.com/Automattic/blocks-
everywhere/issues/135 issue 135]).
The cause appears to be twemoji (this is disabled within the editor
screens in wp-admin, not sure what the historical reason for this is).
The twemoji implementation has a global observer, and any time a DOM node
is introduced, it looks for any emoji, and converts them to corresponding
`img` tags. When a block goes in/out of edit mode, this introduces a DOM
node manipulation, and triggers this observer. This means that reviews (in
this example) get an image tag with a link in it added within the editor
itself, and also has the unintended effect of causing the block you just
wrote to go into recovery mode (as the markup no longer matches what the
`save` function expects).
There is a core ticket that came in recently about the inability to
disconnect the observer at this time
([https://core.trac.wordpress.org/ticket/57517 #57517]), in an ideal
scenario we would probably disconnect the observer on DOM ready, so that
the initial page load gets the twemoji benefits, but any changes happening
after this do not get affected.
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/6703#comment:1>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list