fix(fidelity): escape Markdown/Vue hazards in generated report cells#67
Merged
Conversation
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, "\\|") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The fidelity report page (
website/guide/fidelity.md) is generated byscripts/fidelity-report.mjsand rendered by VitePress, which parses Markdown as Vue. A known-difference description contained a bare<Text>, which VitePress reads as an unclosed HTML element — sovitepress buildfails withElement is missing end tagat that row.This has broken
bun run build:website(and therefore the Pages deploy) onmainsince 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>→<Text>) 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 thefidelity:checkdrift guard stays green (numbers are untouched).Validation
vitepress build websitenow completes cleanly (previously failed atfidelity.md).Context
Found while updating the migration guide (#66); filed separately as it's an unrelated pre-existing deploy break.