Repository navigation
Conversation
|
@simulcast is attempting to deploy a commit to the Lex Team on Vercel. A member of the Team first needs to authorize it. |
simulcast
marked this pull request as ready for review
August 6, 2026 16:24
peterhartree
added a commit
to peterhartree/roughdraft
that referenced
this pull request
Aug 30, 2026
Port the critic-markup serialization hunk from upstream PR Lex-Inc#143 (0d7ef88) by Tristan Rodman. Serializing a code block containing comment anchors or suggestions no longer runs its contents through turndown, which collapsed blank lines and indentation; child nodes are now walked directly so fences round-trip exactly. Co-Authored-By: Claude <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
mermaidfences as diagrams by default with Diagram and Source controlscodeBlockWhy
Roughdraft currently shows Mermaid as plain source, and its fenced-code CriticMarkup serializer routes marked code through Turndown. That path normalizes multiline whitespace and can corrupt indentation and blank lines when a code fence contains a comment or suggestion.
This keeps the Markdown source as the document of record. Mermaid rendering is lazy, uses unique render IDs and stale-result protection, runs with
securityLevel: "strict", follows the system color scheme, and falls back to editable source with an actionable error. Keeping Mermaid as a normal code block is safer for source editing, comment navigation, and exact Markdown round-tripping than replacing it with an atomic diagram node.This also acknowledges the earlier conflicted work in #102. The implementation here preserves the existing code-block schema and review behavior, and never saves generated SVG.
Validation
pnpm --filter @roughdraft/app exec vitest run test/critic-markup.test.ts test/code-block-view.test.tsx test/render-mermaid.test.ts— 70 passedpnpm test:e2e packages/app/e2e/mermaid-code-blocks.spec.ts— 3 passedpnpm check— lint, selector policy, 387 tests, and production builds passedpnpm test:smoke— 12 passedroughdraft-dev-roughdraft; the published global CLI was not changedFixes #115
Fixes #125