Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#31768 closed defect (bug) (fixed)

Press This: Emoji support within the title

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

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 12 years ago.
Chrome 41 on OS X
31768.diff​ (590 bytes ) - added by kraftbj 12 years ago.
swap .text for .html

Download all attachments as: .zip

Change History (9)

@ocean90
12 years ago

Chrome 41 on OS X

#1 @kraftbj
12 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
12 years ago

swap .text for .html

#2 follow-up: @kraftbj
12 years ago

  • Keywords needs-patch added; has-patch removed
  • Summary Press This: Remove title placeholder if emoji is an image → 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
12 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 chard with images... Not sure which is easier/cleaner.

Version 0, edited 12 years ago by azaozz (next)

#4 @michael-arestad
12 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
12 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
12 years ago

  • Keywords needs-patch removed
  • Milestone Awaiting Review → 4.2

Leaving open as this may need more testing.

#7 @azaozz
12 years ago

  • Owner set to azaozz
  • Resolution → fixed
  • Status new → 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.