Skip to content

fix: strip leading UTF-8 BOM from aggregated GitHub content#43

Merged
vbreuss merged 1 commit into
mainfrom
fix/strip-bom-from-aggregated-content
Jun 4, 2026
Merged

fix: strip leading UTF-8 BOM from aggregated GitHub content#43
vbreuss merged 1 commit into
mainfrom
fix/strip-bom-from-aggregated-content

Conversation

@vbreuss

@vbreuss vbreuss commented Jun 4, 2026

Copy link
Copy Markdown
Member

The GitHub API returns file bytes verbatim, so a UTF-8 BOM in a source file (e.g. an extension's Docs/pages/00-index.md) survived decoding and landed at the start of the rendered page. A leading BOM before the first markdown heading stops Docusaurus from parsing it (the heading renders as a literal paragraph) and also breaks StripReadmeFront's H1 detection, since char.IsWhiteSpace(U+FEFF) is false. Drop it once at the single Base64Decode chokepoint so every aggregated file and README is BOM-free.

The GitHub API returns file bytes verbatim, so a UTF-8 BOM in a source file
(e.g. an extension's Docs/pages/00-index.md) survived decoding and landed at
the start of the rendered page. A leading BOM before the first markdown
heading stops Docusaurus from parsing it (the heading renders as a literal
paragraph) and also breaks StripReadmeFront's H1 detection, since
char.IsWhiteSpace(U+FEFF) is false. Drop it once at the single Base64Decode
chokepoint so every aggregated file and README is BOM-free.
@vbreuss vbreuss self-assigned this Jun 4, 2026
@vbreuss vbreuss added the bug Something isn't working label Jun 4, 2026
@vbreuss
vbreuss enabled auto-merge (squash) June 4, 2026 18:31
@vbreuss
vbreuss merged commit d557b0f into main Jun 4, 2026
3 checks passed
@vbreuss
vbreuss deleted the fix/strip-bom-from-aggregated-content branch June 4, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant