URL: Handle HTML entities and ampersand in 'cleanForSlug'#70078
URL: Handle HTML entities and ampersand in 'cleanForSlug'#70078
Conversation
|
Size Change: +29 B (0%) Total Size: 1.85 MB
ℹ️ View Unchanged
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @APCgit. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Flaky tests detected in a17eb97. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/14884618175
|
I might do that in a follow-up. Why?
|
Could make sense if we promise to match the logic. Based on the pre-existing comment, I'd say it's actually fine to skip that. |
| // Convert each group of whitespace, periods, and forward slashes to a hyphen. | ||
| .replace( /[\s\./]+/g, '-' ) | ||
| // Remove all HTML entities. | ||
| .replace( /&\S+?;/g, '' ) |
There was a problem hiding this comment.
I borrowed this from the WordCounter file - https://github.com/WordPress/wordpress-develop/blob/163836d89fecd506e3a2cf23182e14237738a4cf/src/js/_enqueues/wp/utils/word-count.js#L75.
tyxla
left a comment
There was a problem hiding this comment.
This LGTM from my perspective 👍
I think the pre-existing comment does a good enough job to express the intent.
|
Thanks for the feedback and review, @tyxla! |
|
I am checking the PRs with the "Backport to WP Minor Release" label applied to clarify which PRs should be backported to the WordPress 6.8.2 release. From what I understand, this is not a new issue in 6.8, but it is a small and useful improvement that may be worth including in the 6.8.2 release. |
Unlinked contributors: APCgit. Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org> Co-authored-by: Soean <soean@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: 2ndkauboy <kau-boy@git.wordpress.org> Co-authored-by: annezazu <annezazu@git.wordpress.org> Co-authored-by: marcarmengou <marc4@git.wordpress.org> Co-authored-by: tharsheblows <tharsheblows@git.wordpress.org>
…70078) Unlinked contributors: APCgit. Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org> Co-authored-by: Soean <soean@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: 2ndkauboy <kau-boy@git.wordpress.org> Co-authored-by: annezazu <annezazu@git.wordpress.org> Co-authored-by: marcarmengou <marc4@git.wordpress.org> Co-authored-by: tharsheblows <tharsheblows@git.wordpress.org>
Unlinked contributors: APCgit. Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org> Co-authored-by: Soean <soean@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: 2ndkauboy <kau-boy@git.wordpress.org> Co-authored-by: annezazu <annezazu@git.wordpress.org> Co-authored-by: marcarmengou <marc4@git.wordpress.org> Co-authored-by: tharsheblows <tharsheblows@git.wordpress.org>
|
This PR was cherry-picked into the |
What?
Closes #62543.
Supersedes #62549.
Supersedes #68813.
PR adds handlers for HTML entities and ampersands to the
cleanForSlugmethod.Why?
Matches the logic and behavior of
sanitize_title_with_dashes.Testing Instructions
Ampersand &&& testing.Testing Instructions for Keyboard
Same.
Screenshots or screencast