Skip to content

fix(fidelity): escape Markdown/Vue hazards in generated report cells#67

Merged
danfry1 merged 1 commit into
mainfrom
fix/fidelity-report-md-escaping
Jul 1, 2026
Merged

fix(fidelity): escape Markdown/Vue hazards in generated report cells#67
danfry1 merged 1 commit into
mainfrom
fix/fidelity-report-md-escaping

Conversation

@danfry1

@danfry1 danfry1 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

What

The fidelity report page (website/guide/fidelity.md) is generated by scripts/fidelity-report.mjs and rendered by VitePress, which parses Markdown as Vue. A known-difference description contained a bare <Text>, which VitePress reads as an unclosed HTML element — so vitepress build fails with Element is missing end tag at that row.

This has broken bun run build:website (and therefore the Pages deploy) on main since the report began publishing that row.

Fix

Escape free-text table cells in the generator before interpolating them into Markdown — angle brackets (</> → entities), table-breaking pipes (|\|), and Vue interpolation ({{/}}). This covers both the probe-reason cells and the known-difference rows, so any corpus-derived text is safe to render.

The one currently-affected cell (<Text>&lt;Text&gt;) is updated in the committed page to match the fixed generator's deterministic output. That is the only token the new escaping changes, so the committed page equals a fresh regeneration and the fidelity:check drift guard stays green (numbers are untouched).

Validation

  • vitepress build website now completes cleanly (previously failed at fidelity.md).
  • The escaping only rewrites hazard characters; probe numbers and all other content are unchanged.

Context

Found while updating the migration guide (#66); filed separately as it's an unrelated pre-existing deploy break.

The fidelity report is rendered by VitePress, which parses Markdown as
Vue. A known-difference description contained a bare `<Text>`, which
VitePress read as an unclosed HTML element — breaking `vitepress build`
(and the Pages deploy) since the report began publishing that row.

Escape free-text table cells in the generator (angle brackets, pipes, and
{{ }} interpolation) so corpus-derived text can't break the page. Applies
to probe reasons and known-difference rows. The one currently-affected
cell (<Text>) is updated in the committed page to match the fixed
generator's deterministic output, keeping the drift check green.
Comment on lines +107 to +108
String(s ?? "")
.replace(/\|/g, "\\|")
@danfry1 danfry1 merged commit 24c5c3c into main Jul 1, 2026
25 of 27 checks passed
@danfry1 danfry1 deleted the fix/fidelity-report-md-escaping branch July 1, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants