Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode HTML entities for publish link #19517

Merged
merged 1 commit into from
Jan 9, 2020
Merged

Decode HTML entities for publish link #19517

merged 1 commit into from
Jan 9, 2020

Conversation

gwwar
Copy link
Contributor

@gwwar gwwar commented Jan 8, 2020

Follow up to #19187, this PR decodes HTML entities in the post title on the publish panel.

Note the explicit use of decodeEntities vs lodash unescape. The unescape function does not handle leading zeros in HTML entities correctly and should be avoided.

Before After
Screen Shot 2020-01-08 at 4 45 05 PM Screen Shot 2020-01-08 at 4 45 40 PM

Testing Instructions

  • Create a new post and add a title that is an HTML entity like ' or &
  • Publish the post
  • Verify in the pre-publish panel that the link is correct

Copy link
Member

@ellatrix ellatrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

@ellatrix ellatrix merged commit 2db963f into master Jan 9, 2020
@ellatrix ellatrix deleted the fix/publish-link branch January 9, 2020 06:55
@gwwar
Copy link
Contributor Author

gwwar commented Jan 9, 2020

Thanks @ellatrix!

@ellatrix ellatrix added this to the Gutenberg 7.3 milestone Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants