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

Fix Post Date block escaping of date HTML #38023

Merged
merged 1 commit into from
Jan 17, 2022
Merged

Conversation

getdave
Copy link
Contributor

@getdave getdave commented Jan 17, 2022

Description

In #37876 (comment) we learnt that we escaped a little too late on the Post date block. This cause the HTML itself to be escaped and thus output on the site as raw HTML. That isn't what we wanted.

This PR reverts that and puts the escaping as close to HTML output time as possible.

How has this been tested?

  • Activate TT2
  • Add some Posts (I used Fakerpress to generate these).
  • Find a Post listing page (probably the front page unless you changed the setting).
  • See that the Post data is outputted as a hyperlink without any HTML being displayed.

Screenshots

Before

Screen Shot 2022-01-17 at 09 23 54

After

Screen Shot 2022-01-17 at 09 24 14

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).
  • I've updated related schemas if appropriate.

@getdave getdave requested a review from scruffian January 17, 2022 09:20
@getdave getdave added [Block] Post Date Affects the Post Date Block [Type] Bug An existing feature does not function as intended [Type] Code Quality Issues or PRs that relate to code quality labels Jan 17, 2022
@getdave getdave self-assigned this Jan 17, 2022
@getdave getdave removed the [Type] Code Quality Issues or PRs that relate to code quality label Jan 17, 2022
@getdave getdave marked this pull request as ready for review January 17, 2022 09:26
@getdave getdave requested a review from ajitbohra as a code owner January 17, 2022 09:26
@getdave getdave requested a review from ehti January 17, 2022 09:27
Copy link
Contributor

@MaggieCabrera MaggieCabrera left a comment

Choose a reason for hiding this comment

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

I could reproduce this on Blockbase too and this fixes it, LGTM!

@getdave
Copy link
Contributor Author

getdave commented Jan 17, 2022

Test failure unrelated. Rerunning

Copy link
Contributor

@scruffian scruffian left a comment

Choose a reason for hiding this comment

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

LGTM

@getdave
Copy link
Contributor Author

getdave commented Jan 17, 2022

OK I know that this test failure is not related to this PR so I'm going to merge anyway and then look to fix the e2e test in another PR.

@getdave getdave merged commit 0d0f7d4 into trunk Jan 17, 2022
@getdave getdave deleted the fix/post-date-escaping branch January 17, 2022 10:57
@github-actions github-actions bot added this to the Gutenberg 12.5 milestone Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Date Affects the Post Date Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants