fix: strip hidden Unicode (U+200B) from build output #6
No reviewers
Labels
No labels
dependencies
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
alex/opengist-viewer!6
Loading…
Reference in a new issue
No description provided.
Delete branch "pi/issue5-1784175204059"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes #5 — resolves the Renovate warning about hidden Unicode characters in the repository.
Root cause
Renovate flagged a hidden Unicode character in the repo. The only occurrence was a zero-width space (U+200B) in
dist/index.html, inside a CSS rule that originates from the@picocss/picoframework:Vite inlines the pico.min.css stylesheet into the single-file
dist/index.html, so the literal byte ends up committed to the repo.Fix
Since
dist/index.htmlis a committed build artifact that CI rebuilds on every push tomaster, simply editing the file would let the character come back on the next rebuild. This PR fixes it at the build step:scripts/strip-invisible.mjs(new) — a post-build sanitizer that scans the generated bundle and replaces hidden/invisible Unicode characters with safe ASCII equivalents. The U+200B is replaced with its semantically-identical CSS escape\200B(valid inside a CSScontent:"…"string, but with no hidden bytes). It also warns loudly if any other suspicious invisible/bidi characters are found.package.json— added apostbuildlifecycle hook (node scripts/strip-invisible.mjs) so everybun run build/npm run buildproduces clean output automatically.dist/index.html— cleaned the already-committed artifact (the only character flagged).Verification
\200Bis functionally identical to the literal U+200B insidecontent:"", so rendering/behavior is unchanged.