Strip English Executive Brief carrier so it no longer leaks into the article TOC#2840
Conversation
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🏷️ Automatic Labeling SummaryThis PR has been automatically labeled based on the files changed and PR metadata. Applied Labels: testing,refactor,size-l Label Categories
For more information, see |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
…Brief En TOC entry Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
There was a problem hiding this comment.
Pull request overview
This PR fixes an edge case in the article lead localization pipeline where an embedded executive-brief_en.md artifact could survive as a ## Executive Brief En carrier and leak into the rendered article body and in-article TOC. The change makes carrier stripping include English suffixes while preserving the legacy unsuffixed ## Executive Brief lead heading.
Changes:
- Update carrier-stripping logic to treat
Executive Brief Enas a removable embedded carrier section (same as other localized carriers). - Add regression tests covering (a) stripping the English carrier, (b) preserving the legacy unsuffixed heading, and (c) English render-path behavior.
- Regenerate affected
news/2026-05-15-propositions-*.htmloutputs to remove the leaked TOC entry and duplicated carrier section.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/render-lib/article-brief-lead.ts | Includes English in localized brief suffix matching so Executive Brief En carriers are stripped without impacting the canonical/legacy lead headings. |
| tests/article-brief-lead.test.ts | Adds regression coverage for stripping Executive Brief En while preserving canonical/legacy lead behavior. |
| tests/section-title-i18n.test.ts | Expands TOC localization coverage assertions for additional mapped slugs and adds targeted regression expectations. |
| news/2026-05-15-propositions-en.html | Regenerated to remove leaked Executive Brief En TOC entry/body section and update timestamps. |
| news/2026-05-15-propositions-sv.html | Regenerated to remove leaked Executive Brief En TOC entry/body section and update timestamps. |
| news/2026-05-15-propositions-da.html | Regenerated to remove leaked Executive Brief En TOC entry/body section and update timestamps. |
| news/2026-05-15-propositions-no.html | Regenerated to remove leaked Executive Brief En TOC entry/body section and update timestamps. |
| news/2026-05-15-propositions-de.html | Regenerated to remove leaked Executive Brief En TOC entry/body section and update timestamps. |
| news/2026-05-15-propositions-fr.html | Regenerated to remove leaked Executive Brief En TOC entry/body section and update timestamps. |
| news/2026-05-15-propositions-es.html | Regenerated to remove leaked Executive Brief En TOC entry/body section and update timestamps. |
| news/2026-05-15-propositions-nl.html | Regenerated to remove leaked Executive Brief En TOC entry/body section and update timestamps. |
| news/2026-05-15-propositions-ar.html | Regenerated to remove leaked Executive Brief En TOC entry/body section and update timestamps. |
| news/2026-05-15-propositions-he.html | Regenerated to remove leaked Executive Brief En TOC entry/body section and update timestamps. |
| news/2026-05-15-propositions-ja.html | Regenerated to remove leaked Executive Brief En TOC entry/body section and update timestamps. |
| news/2026-05-15-propositions-ko.html | Regenerated to remove leaked Executive Brief En TOC entry/body section and update timestamps. |
| news/2026-05-15-propositions-zh.html | Regenerated to remove leaked Executive Brief En TOC entry/body section and update timestamps. |
An
executive-brief_en.mdartifact is embedded by the aggregator as a## Executive Brief Encarrier heading. Because the lead-localizer's suffix list excluded English, that carrier survived into the rendered output and leaked into both the in-article TOC and body — visible in the committed2026-05-15/propositionsbuild (the only subfolder with this artifact), not just single-language isolation.Root cause
stripEmbeddedLocalizedBriefSections(article-brief-lead.ts) strips## Executive Brief <Lang>carriers, butLOCALIZED_BRIEF_TITLE_SUFFIXESwas built fromLANGUAGES.filter((l) => l !== 'en').<h2 id="rm-executive-brief-en">has no slug localization, sogenerateArticleTocfalls back to raw text "Executive Brief En" → TOC leak (and a duplicate brief body section).Changes
scripts/render-lib/article-brief-lead.ts— include all 14 languages (English included) inLOCALIZED_BRIEF_TITLE_SUFFIXES. The\bboundary inEMBEDDED_BRIEF_SECTION_REstill preserves the legacy unsuffixed## Executive Brief/## What Happenedcanonical lead. JSDoc updated to explain the English inclusion.tests/article-brief-lead.test.ts— regression tests for (a) stripping a stray## Executive Brief Encarrier, (b) preserving the legacy unsuffixed lead, (c) the English render-path stripping the En carrier while keeping the canonical lead.news/2026-05-15-propositions-*.html(14 languages) — regenerated; the leaked TOC entry and duplicate carrier section are removed while the canonicalWhat Happenedlead is preserved.Notes
SECTION_TITLESslug resolves throughlocalizedSectionTitle(0 uncovered), so no additional i18n gaps remain.mermaid-coverage-regressionon the unmodified2026-05-15/propositions/article.mdis unrelated to this change.