From 928dd567f7646e7fc98767955132d080c289111c Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Wed, 23 Sep 2026 12:51:14 +0100 Subject: [PATCH] DOC-7104: Fix diff_rendered_hrefs.py to catch unquoted href attributes 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 --- build/diff_rendered_hrefs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/diff_rendered_hrefs.py b/build/diff_rendered_hrefs.py index c7c950e180..73daf1807f 100644 --- a/build/diff_rendered_hrefs.py +++ b/build/diff_rendered_hrefs.py @@ -25,7 +25,11 @@ import hashlib NOISY_PREFIXES = ("develop/ai/redisvl/", "operate/rc/changelog/") -HREF_RX = re.compile(r'href="[^"]*"') +# `hugo --minify` drops attribute quotes wherever the value has no whitespace +# or quote characters, which is nearly always for an href -- on a sampled page +# only 5 of 240 hrefs stayed quoted. A quoted-only pattern therefore +# fingerprints almost nothing and reports "0 diffs" even when links changed. +HREF_RX = re.compile(r'href="[^"]*"|href=\'[^\']*\'|href=[^\s"\'`=<>]+') def fingerprint(public_dir, prefix_filter=None):