Repository navigation
Mount message directive embeds glued to trailing prose - #4410
Merged
Merged
Conversation
remark-directive only emits a leafDirective when `::name{...}` ends its
line. Agents often continue with prose right after the closing brace,
so the line parses as a plain paragraph and the embed renders as
literal text. Split a leading registered `::name{...}` off the
paragraph into a mount node and keep the rest as a paragraph.
…beds
The fallback that mounts `::name{...}` directives followed by prose on
the same line adds 1.9 KB raw to the workspace route closure. Brotli
stays within its existing limit.
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.
Human comments
What was wrong
remark-directiverequires leaf directives to end their line. A registered embed followed by prose, such as::inline-vis{file="demo.html"}Next **bold** tail, rendered as literal text. Parsing already-decoded paragraph text as a fallback also activated escaped examples, changed attribute values, and applied the mount limit out of source order.What changed
Extend the existing micromark text-directive tokenizer to recognize the extra colon at the start of a paragraph for registered, non-colliding directives with a complete attribute block on the same line. Reuse the directive grammar for names, labels, attributes, entities, and quoting; preserve the original source and trailing Markdown nodes. Allocate standalone and glued mounts in one traversal so the first 32 directives in document order mount.
Escaped syntax, code, unknown or colliding names, incomplete attributes, and brace-less forms retain their literal behavior. Merge current main and retain its bundle budget; this change needs no budget increase. The new direct dependency was already present transitively through
remark-directive. No wire or SDK contract changes.How you verified
pnpm exec turbo run typecheck lint --filter=@bb/apppasses; formatting and diff checks pass.pnpm exec turbo run build --filter=@bb/apppasses. The bundle-budget checker passes against main's unchanged limits: SplitWorkspaceRoute 2239.3 KiB raw / 601.4 KiB brotli, below 2284.3 / 615.8 KiB.Fixes #4409