WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#31768 closed defect (bug) (fixed)

Press This: Emoji support within the title

Reported by: ocean90 Owned by: azaozz
Milestone: 4.2 Priority: low
Severity: normal Version: 4.2
Component: Press This Keywords:
Focuses: javascript Cc:

Description

If a browser doesn't support native emojis they are replaced with an image. Since $titleField.text() doesn't catch the HTML the placeholder will be still shown.

Attachments (2)

31768.png (21.9 KB) - added by ocean90 6 years ago.
Chrome 41 on OS X
31768.diff (590 bytes) - added by kraftbj 6 years ago.
swap .text for .html

Download all attachments as: .zip

Change History (9)

@ocean90
6 years ago

Chrome 41 on OS X

#1 @kraftbj
6 years ago

  • Keywords has-patch added; needs-patch removed

Swapping out .text for .html all that is needed here? It seems to work for me with that change (attached).

Any downsides to this or missed edge cases?

@kraftbj
6 years ago

swap .text for .html

#2 follow-up: @kraftbj
6 years ago

  • Keywords needs-patch added; has-patch removed
  • Summary changed from Press This: Remove title placeholder if emoji is an image to Press This: Emoji support within the title

Hold up on 31768.diff. Actually saving the title with emoji fails. Emoji is stripped out.

#3 in reply to: ↑ 2 @azaozz
6 years ago

Replying to kraftbj:

It is insecure too :)

Best is to use a textarea there. The bad thing about textareas is that they don't "fit" their content, i.e. don't resize to accommodate longer titles. We probably can hack that with some JS. Will solve this and other similar problems.

Another option is: we have to mimic the behavior of a form element; no replacements of emoji chars with images... Not sure which is easier/cleaner.

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

#4 @Michael Arestad
6 years ago

I'd prefer we kept the h2, but I defer the decision to @azaozz. I can fix up the styles when needed, but I suspect both solutions will be messy.

#5 @azaozz
6 years ago

In 31919:

Press This:

  • When saving, replace emoji images with chars in the title text.
  • Clean up the title text on paste.

See #31768.

#6 @azaozz
6 years ago

  • Keywords needs-patch removed
  • Milestone changed from Awaiting Review to 4.2

Leaving open as this may need more testing.

#7 @azaozz
5 years ago

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

In 31987:

Press This: prevent pasting of HTML in the title H2. Insert the clipboard text instead.
Fixes #31768.

Note: See TracTickets for help on using tickets.