Finding
scripts/cache_supplements.py writes extracted supplementary text verbatim. Docx supplements can carry spaces at line ends, which means a freshly generated references_cache/*.supplement.md can trip git diff --check.
Why it matters
PR #916 needed a mechanical trim after fetching PMID:42549325. Rerunning the generator should not recreate whitespace that the index rejects.
Fix
Normalize extracted supplement text before writing by trimming end-of-line spaces, and add a focused regression test around cache_one output.
Finding
scripts/cache_supplements.py writes extracted supplementary text verbatim. Docx supplements can carry spaces at line ends, which means a freshly generated references_cache/*.supplement.md can trip git diff --check.
Why it matters
PR #916 needed a mechanical trim after fetching PMID:42549325. Rerunning the generator should not recreate whitespace that the index rejects.
Fix
Normalize extracted supplement text before writing by trimming end-of-line spaces, and add a focused regression test around cache_one output.