Skip to content

Frontend: Fix lazy highlight.js aliases and autodetection#3724

Merged
reakaleek merged 4 commits into
mainfrom
fix/hljs-lazy-load-aliases
Jul 24, 2026
Merged

Frontend: Fix lazy highlight.js aliases and autodetection#3724
reakaleek merged 4 commits into
mainfrom
fix/hljs-lazy-load-aliases

Conversation

@reakaleek

Copy link
Copy Markdown
Member

What

  • Load all curated highlight.js grammars when a page or message contains any code block
  • Route static docs and React Markdown through one async DOM highlighter
  • Add tests for language aliases (js, ts, jsx) and unlabeled fence autodetection

Why

Notes

  • Pages without code blocks still load zero language chunks
  • The first code-bearing page loads all curated grammars once per session, then caches them for later swaps and messages

Made with Cursor

Load all curated grammars when any code block is present so highlight.js
native aliases and autodetection work again after the lazy-load change.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@reakaleek
reakaleek requested a review from a team as a code owner July 24, 2026 18:58
@reakaleek reakaleek added the bug label Jul 24, 2026
@reakaleek
reakaleek requested a review from cotti July 24, 2026 18:58
reakaleek and others added 3 commits July 24, 2026 21:12
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Reuse Marked's renderer and shared instance to remove duplicate parsing and rendering code.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@reakaleek
reakaleek merged commit 2176ad6 into main Jul 24, 2026
24 checks passed
@reakaleek
reakaleek deleted the fix/hljs-lazy-load-aliases branch July 24, 2026 19:38
@reakaleek

Copy link
Copy Markdown
Member Author

Merging to hotfix prod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant