Repository navigation
fix: renderInlineAsync no longer routes async render through patched sync renderInline (#35) - #36
Merged
serkodev merged 1 commit intoAug 24, 2026
Conversation
…sync renderInline (serkodev#35)
antfubot
force-pushed
the
fix/renderinlineasync-sync-fallback
branch
from
August 24, 2026 06:11
5999bcb to
4cc47fb
Compare
Contributor
Owner
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
Renderer.renderInlineAsync()(new in1.2.0) delegated to a monkey-patched syncrenderInlinewhenever one was present. When a plugin wraps bothrenderInlineandrenderInlineAsync— a natural, async-aware pattern (e.g.@comark/markdown-it) — the async render was routed back through the sync path, which throwsRenderer.renderInline: async rule detectedin the presence of async inline rules (Shiki, KaTeX, etc.).This scopes the sync fallback so it is honored only when
renderInlineAsyncitself is not patched. If a plugin also wrapsrenderInlineAsync, its async-aware wrapper has already run its preprocessing by the time control reaches the prototype method, so delegating to the sync path is both unnecessary and unsafe — instead the proper async loop runs.The existing behavior of honoring a plugin that patches only
renderInlineis preserved.Fixes #35.
Why
This breaks real-world downstreams: Slidev decks with
comark: trueapply@comark/markdown-iton top of async Shiki/KaTeX inline rules, soslidev buildfails on any install resolvingmarkdown-exit@1.2.0(slidevjs/slidev#2717 pinned to1.1.0-beta.2as a stopgap).Verification
Added a TDD regression test that wraps both inline render methods with an async
code_inlinerule (the reproduction from the issue) — it fails before the fix with the reported error and passes after. Full suite (966 tests), lint, build, and typecheck all pass.This PR was created with the help of an agent.