How a two-line code fix caught duplicate H1 tags across 500 blog pages
A developer discovered that 500 out of 1,360 blog pages contained two H1 tags, harming SEO and screen-reader accessibility. The bug arose because both the page template and each Markdown article independently rendered a valid top-level heading, making their combined output incorrect. Existing test suites missed the issue entirely because they checked source files and templates in isolation rather than the final built HTML. The fix involved demoting in-body H1 tags to H2 during the build step and adding a three-line output-level gate that fails the build if any page holds a count other than exactly one H1. The episode highlighted a broader principle: when each individual component appears correct but the combined result is not, testing must target the final output rather than its inputs.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in