fix(website): escape generic angle brackets in benchmark snippets#305
Merged
Conversation
The hand-highlighted benchmark snippets pass token text through the escaping helpers, but angle brackets written directly in the template strings reach the HTML raw. Generics such as PredicateBuilder<Pet, *, *> and List<Long> emit a bare < immediately followed by a <span> tag, which the HTML minifier (Terser) rejects, failing static generation of /benchmarks and the docs deploy. Escape those brackets as </>, the convention the page already uses for its other snippets. The copy button unescapes entities, so copied code text is unchanged.
There was a problem hiding this comment.
Pull request overview
Fixes the Docusaurus static generation failure for /benchmarks by escaping generic angle brackets inside the hand-highlighted benchmark snippet template strings, preventing invalid <<span ...> sequences during HTML minification.
Changes:
- Replaced raw
<...>generic markers written directly in snippet template strings with</>in the affected benchmark code snippets. - Covered generics in multiple benchmark sections (e.g., batch insert, dynamic query, graph insert) so Terser/HTML minification no longer encounters
<<span ...>parse errors.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Problem
The Deploy Documentation run for the benchmark page (run 29904706678) failed in the Build Docusaurus step: static generation of
/benchmarksaborted withHTML minification failed (Terser), so the deploy never happened.The hand-highlighted snippets escape the text passed through the token helpers (
T(),F(), …), but angle brackets written directly in the template strings reach the HTML raw. Generics such asPredicateBuilder<Pet, *, *>andList<Long>emit a bare<immediately followed by a<span>tag (<<span …). Browsers tolerate that; Terser's HTML parser rejects it and the whole build fails.Fix
Escape the angle brackets on the 15 affected snippet lines as
</>, the convention the page already uses for its other snippets (e.g.Entity<Long>). The chart's SVG<text>lines are real markup and stay as-is. The copy button unescapes entities, so copied code text is unchanged.Verification
npm run buildsucceeds and generatesbuild/benchmarks/index.html.PredicateBuilder<Pet, *, *>, 20 escapedList<occurrences).index.js, the other file touched by feat(website): benchmark page for the 12-workload suite #298, scanned clean for the same pattern.