Fixes inconsistent filtering of the paper's text in the Subheading distribution assessment#22882
Merged
marinakoleva merged 3 commits intotrunkfrom Jan 21, 2026
Conversation
Pull Request Test Coverage Report for Build 528b5e401b5adaa0b856ef519fe28292db5e819eDetails
💛 - Coveralls |
…-table-of-content-assessment-is-broken-with-long-text-and-toc-block
…f-content-assessment-is-broken-with-long-text-and-toc-block
Contributor
|
CR: 👍 We could improve the |
Contributor
|
Acceptance (in WP): 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
hasSubheadings()checked for subheadings on the raw text (without filtering blocks), whilegetResultfiltered blocks before analyzing the subheadings.hasSubheadings()is a bit overkill, as it would be necessary only in the scenario where the user has shortcodes with headings inside them. Still, decided to have this step here as well so that the filtering forhasSubheadings()andgetSubheadingTextLengthsis identical.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Bug replication: WP
mainbranches ortrunkAn error occurred in the 'subheadingsTooLong' assessmentin the Readability analysis tab and that you can't see a feedback string for the Subheading distribution assessmentCannot read properties of undefined (reading 'countLength')Testing fix: WP
trunkusing the commandcomposer require yoast/wordpress-seo:dev-1-table-of-content-assessment-is-broken-with-long-text-and-toc-block@devYou are not using any subheadings, although your text is rather long. Try and add some subheadings.with a red 🔴 traffic light.Testing fix: Shopify
An error occurred in the 'subheadingsTooLong' assessmentYou are not using any subheadings, although your text is rather long. Try and add some subheadings.with a red 🔴 traffic light.Relevant test scenarios
Test instructions for QA when the code is in the RC
QA can test this PR by following these steps:
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.[yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached theGoogle Docs Add-onlabel to this PR.Documentation
Quality assurance
grunt build:imagesand commited the results, if my PR introduces new images or SVGs.Innovation
innovationlabel.Fixes #1