Repository navigation
perf(md): make Markdown compilation 15× faster - #847
Merged
cpojer merged 2 commits intoNov 16, 2026
Merged
Conversation
kotarotaniguchi0523
force-pushed
the
claude/funny-davinci-nymx83
branch
from
November 16, 2026 04:26
4e04f2d to
1ebee1a
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
kotarotaniguchi0523
force-pushed
the
claude/funny-davinci-nymx83
branch
from
November 16, 2026 04:28
1ebee1a to
37cc43a
Compare
kotarotaniguchi0523
force-pushed
the
claude/funny-davinci-nymx83
branch
2 times, most recently
from
November 16, 2026 05:20
f026a9d to
d729504
Compare
Highlighting was 91% of the time spent compiling Markdown. Code blocks are
now highlighted by @pierre/highlights, a WebAssembly lexer, which makes the
Markdown compile step about 15 times faster. The parser, the plugins, the
rendered markup and the default themes stay as they are.
- `src/highlight.ts` builds the lines from per-line tokens and applies the
`{1,3-5}` line range and the `[!code ...]` comment notations with the same
classes as before.
- Token boundaries and classification differ from Shiki, so some colors
change within the same themes.
- `themes` replaces `shiki.themes`, which still works and is deprecated.
- Focus dimming now applies: the CSS selected `has-focus`, but the class on
the block is `has-focused`.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011f44HGUmdFJgasJzEr7dQk
kotarotaniguchi0523
force-pushed
the
claude/funny-davinci-nymx83
branch
from
November 16, 2026 05:25
d729504 to
7951cde
Compare
cpojer
approved these changes
Nov 16, 2026
cpojer
left a comment
Member
There was a problem hiding this comment.
This is awesome, thank you so much!
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.
Replace Shiki with
@pierre/highlightsfor Markdown syntax highlighting. Highlighting accounted for 91% of@void/mdcompile time.On the Void docs and playground pages, Markdown compilation is approximately 15× faster:
Measured on Node 22 with 4 vCPU. These numbers cover Markdown compilation, not the whole build.
Appearance and compatibility
The default
github-lightandgithub-darkthemes stay the same, but some code colors change because the new lexer classifies tokens differently.Left: Shiki on
main. Right:@pierre/highlightson this branch.themes;shiki.themesremains supported but is deprecated.[!code ...]notations are read from comments only. An INI comment after a value is an exception and is not recognized.This also fixes focus dimming, code block and line-number backgrounds, and dark-theme bold and italic styles.
Validation
vp run build:all,vp run check,vp lint, andvp fmt --checkpassed.mainin the same environment.🤖 Generated with Claude Code