WordPress.org

Make WordPress Core

Opened 3 weeks ago

Last modified 2 weeks ago

#44310 reopened defect (bug)

Apostrophe and/or Hyphen in Titles Rendered as ’ and – When Added as Link in Editor

Reported by: midihead Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.6
Component: Editor Keywords: has-screenshots
Focuses: Cc:

Description

I searched but did not see this issue reported previously.

When an apostrophe and/or a hyphen is present in a blog post title or page title and those posts are added as links using the Insert Link option in the WordPress Editor, the apostrophe and hyphen are rendered as the following:

  • An apostrophe in a title is rendered as ’ in the Link Text (see attached images)
  • A hyphen (which is surrounded by spaces) in a title is rendered as – in the Link text (see attached images)

I have tested on a vanilla WordPress 4.9.6 install with no other plugins active both on live installs on two different servers and a local development server and can reproduce this consistently.

Attachments (5)

WordPress Issue 2.png (104.0 KB) - added by midihead 3 weeks ago.
WordPress Issue 1.png (91.4 KB) - added by midihead 3 weeks ago.
WordPress Issue 3.png (94.8 KB) - added by midihead 3 weeks ago.
WordPress Issue 4.png (100.9 KB) - added by midihead 3 weeks ago.
Screenshot from 2018-06-06 18_40_50.png (9.0 KB) - added by subrataemfluence 2 weeks ago.

Download all attachments as: .zip

Change History (8)

#1 @midihead
3 weeks ago

  • Summary changed from Apostrophe and/or Hyphen in Titles Rendered as ’ and When Added as Link in Editor to Apostrophe and/or Hyphen in Titles Rendered as ’ and – When Added as Link in Editor

#2 @subrataemfluence
2 weeks ago

  • Keywords needs-patch removed
  • Resolution set to invalid
  • Status changed from new to closed

I could not reproduce the issue. Please see screenshot.

#3 @midihead
2 weeks ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

Thanks for your response. I'm not sure that I clearly explained the issue the first time. In your screenshot, it appears that you typed out the apostrophe and the hyphen as text in the body of the editor instead of inserting a link to an existing post or page that already contains an apostrophe and/or hyphen (with spaces) in the title.

Steps to reproduce:

  1. Create a post or page and insert an apostrophe and/or a hyphen (with spaces) in the title and save it.
  2. In any post or page, click the Insert/Edit Link button, search for the existing post that has the apostrophe and/or hyphen (with spaces) in the title, select that post from the list and click Apply.
  3. The inserted link will render the apostrophe as ’ and the hyphen (with spaces) as –

To more clearly demonstrate how to reproduce this issue, I have recorded a short video where I clearly show and explain how to consistently reproduce this issue. https://youtu.be/mPrzne9ZNkA

If you follow the steps above or in the video as I've shown, you should clearly see the issues with the apostrophe and hyphen occur.

Thank you very much.

Note: See TracTickets for help on using tickets.