Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#47489 closed defect (bug) (fixed)

Emoji are substituted in preformatted blocks

Reported by: jikamens Owned by: pento
Priority: normal Milestone: 5.2.3
Component: Emoji Version:
Severity: normal Keywords: has-patch has-unit-tests needs-testing fixed-major
Cc: Focuses:

Description

I have a preformatted block in a posting that is a shell script. There's a line in the shell script which ends in ":)". When I preview the posting those two characters are replaced by a smiley face. Emoji substitution should not happen inside preformatted blocks.

Attachments (1)

47489.diff (1.6 KB ) - added by pento 7 years ago.

Download all attachments as: .zip

Change History (7)

#1 @SergeyBiryukov
7 years ago

  • Component GeneralEmoji

@pento
7 years ago

#2 @pento
7 years ago

  • Keywords has-patch has-unit-tests added
  • Milestone Awaiting Review5.3

Thank you for the bug report, @jikamens!

The convert_smilies() function is supposed to ignore smilies in <pre> tags, bug it doesn't work correctly if the tag has attributes on it.

47489.diff adds support for this case, along with unit tests.

#3 @pento
7 years ago

  • Owner set to pento
  • Resolutionfixed
  • Status newclosed

In 45569:

Formatting: Don't convert smilies in ignored tags that have attributes.

Smilies in ignored tags are not supposed to be converted to emoji, but this can malfunction if the tag has attributes. For example, the Preformatted block with add a class to the <pre> tag.

Props pento, jikamens.
Fixes #47489.

#4 @pento
7 years ago

#44278 was marked as a duplicate.

#5 @JeffPaul
7 years ago

  • Keywords needs-testing fixed-major added
  • Milestone 5.35.2.3
  • Resolution fixed
  • Status closedreopened

Reopening this so it can be back-ported to the 5.2 branch, also needs testing to validate if this ticket is good to land in 5.2.3.

#6 @SergeyBiryukov
7 years ago

  • Resolutionfixed
  • Status reopenedclosed

In 45837:

Formatting: Don't convert smilies in ignored tags that have attributes.

Smilies in ignored tags are not supposed to be converted to emoji, but this can malfunction if the tag has attributes. For example, the Preformatted block with add a class to the <pre> tag.

Props pento, jikamens.
Merges [45569] to the 5.2 branch.
Fixes #47489.

Note: See TracTickets for help on using tickets.