Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#47489 closed defect (bug) (fixed)

Emoji are substituted in preformatted blocks

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

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 5 years ago.

Download all attachments as: .zip

Change History (7)

#1 @SergeyBiryukov
5 years ago

  • Component changed from General to Emoji

@pento
5 years ago

#2 @pento
5 years ago

  • Keywords has-patch has-unit-tests added
  • Milestone changed from Awaiting Review to 5.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
5 years ago

  • Owner set to pento
  • Resolution set to fixed
  • Status changed from new to closed

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
5 years ago

#44278 was marked as a duplicate.

#5 @JeffPaul
5 years ago

  • Keywords needs-testing fixed-major added
  • Milestone changed from 5.3 to 5.2.3
  • Resolution fixed deleted
  • Status changed from closed to reopened

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
5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

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.