WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 8 months ago

#47532 closed defect (bug) (duplicate)

Multiple dashes in post slugs where title contains a dash surrounded by spaces

Reported by: andizer Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: javascript Cc:

Description

I am not sure if there is already a ticket. I've searched for it and haven't found any tickets. The issue I've got is about a new post where the title contains dashes surrounded by spaces. These spaces are also replaced by dashed in the generated post slug. For example: Korn - Freak on a Leash title will be converted to korn---freak--on-a-leash.

Attachments (1)

dashes.jpg (28.0 KB) - added by Presskopp 8 months ago.

Download all attachments as: .zip

Change History (7)

#1 @Presskopp
8 months ago

I can't reproduce. Did you try with standard theme and all plugins disabled?

#2 @mukesh27
8 months ago

I also can't reproduce same issue in WordPress 5.3-alpha-45524

#3 @andizer
8 months ago

It only happens when you save the post as a draft. In the collapsible with permalink the slug contains the double dashes. When publishing the post it seems the double dashes are removed.

@Presskopp
8 months ago

#4 @Presskopp
8 months ago

Now I see, entering as title:

I'm just a - Test -- yes - - - a test

gives the example like on the screenshot.

This ticket was mentioned in Slack in #core-editor by ocean90. View the logs.


8 months ago

#6 @SergeyBiryukov
8 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

It's the same issue as in #45478 and #46088.

The slug is generated client side, which doesn't have an equivalent of sanitize_title().

Going to close in favour of GB12907, as it needs to be handled in the block editor JS.

Note: See TracTickets for help on using tickets.