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

Append missing </div> to post-excerpt block (#26581) #26806

Merged
merged 1 commit into from
Nov 9, 2020

Conversation

bobbingwide
Copy link
Contributor

Description

In the core/post-excerpt block there's logic that tests if the showMoreOnNewLine attribute is set.
When it was missing or true then the generated HTML was missing a trailing </div>.

This fix adds the missing </div>.

How has this been tested?

  • Tested in a local environment with WordPress 5.6-beta3
  • Tested where the only plugin is Gutenberg
  • Tested with the Twenty Twenty-One Blocks theme
  • Added a <wp:post-excerpt> to a template and demonstrated - using View Source - that the end div tag was no longer missing.

Screenshots

With this simple test setup there was no visible effect to the displayed output.

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • 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.

I can't honestly tick some of the above in the checklist since I don't have a wp-env environment.
This means I can't run the PHPUnit tests, nor other npm run commands that expect it.

Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

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

Thanks for catching the issue and putting together the fix!

Copy link
Member

@aristath aristath left a comment

Choose a reason for hiding this comment

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

Good catch!
LGTM 👍

@talldan
Copy link
Contributor

talldan commented Nov 9, 2020

In terms of the tests, the static analysis issue was fixed in #26811, and the failing end to end test is one that exists in master, related to an issue in a framework we use for accessibility testing (dequelabs/axe-core-npm#98).

So I'll go ahead and merge this.

@talldan talldan merged commit 391a0fd into WordPress:master Nov 9, 2020
@github-actions github-actions bot added this to the Gutenberg 9.4 milestone Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Excerpt Affects the Post Excerpt Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

core/excerpt-block - Missing </div> in render_block_core_post_excerpt() when showMoreOnNewLine
3 participants