DOC-7104: Fix diff_rendered_hrefs.py to catch unquoted href attributes - #4087
Merged
Merged
Conversation
hugo --minify drops attribute quotes wherever the value has no whitespace or quote characters, which is true for nearly every href. HREF_RX only matched href="..." (double-quoted), so on a sampled page it fingerprinted 5 of 240 hrefs and reported "0 diffs" regardless of what actually changed. Verified against the DOC-7104 databases/ and release-notes/ unit builds: the corrected regex surfaces exactly the documented intentional fixes in each (missing-paren relref fixes rendering a previously-dead link, and a cosmetic trailing-slash normalization on relref-resolved targets) and nothing else. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
Contributor
🧠 Redis MemoryFound 5 related items from repository history (5 new this commit):
Memory updated at 928dd56 |
This was referenced Sep 23, 2026
Merged
dwdougherty
approved these changes
Sep 23, 2026
This was referenced Sep 23, 2026
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.
Summary
HREF_RXinbuild/diff_rendered_hrefs.pyonly matched double-quotedhref="..."attributes.hugo --minifydrops quotes on any attribute value with no whitespace/quote characters, which is true for nearly every href — on a sampled release-notes page this left 5 of 240 hrefs visible to the tool, so it fingerprinted almost nothing and could report "0 diffs" regardless of what actually changed.release-notes/) subagent, who simulated the effect and flagged it for a follow-up. I independently reproduced it against the real build outputs from DOC-7104 units 1 and 2 (open PRs #4083, #4086) before fixing.Test plan
🤖 Generated with Claude Code
Note
Low Risk
Build-only verification script change; no runtime docs or production behavior.
Overview
Fixes href fingerprinting in
build/diff_rendered_hrefs.pyso migration verification works on minified Hugo HTML.HREF_RXpreviously matched only double-quotedhref="...".hugo --minifyemits mostly unquotedhref=values, so the tool fingerprinted a tiny subset of links and could falsely report no diffs when links changed. The regex now also matches single-quoted and unquoted hrefs, with a short comment documenting the minify behavior.Reviewed by Cursor Bugbot for commit 928dd56. Bugbot is set up for automated code reviews on this repo. Configure here.