You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Render documents, not their source, on every markdown surface
A review showed a ```mermaid fence as its own source, an unhighlighted
code block, and an image at whatever width the file happened to carry.
Chat and the plan view had diagrams; the review screen never got them,
and a report rendered one way inside a review and another in its own
viewer.
Every markdown surface now renders the same document the same way:
diagrams, highlighted fenced code, images capped to the text column.
In the review pane a diagram REPLACES its <pre> rather than nesting in
one, so it keeps the block's line anchor and is annotatable like any
other passage.
Two rendering bugs surfaced doing it, both from the same root cause --
this bundle strips the <style> mermaid embeds in its SVG:
- Without the natural-width cap that <style> carries, `width: 100%`
stretched a three-node flowchart across a full report column and
scaled its text with it. MermaidBlock re-applies the cap from the
viewBox.
- Mermaid sizes each label from a hidden measurement on <body>, and
that same <style> pins the rendered label to match. Left to inherit
the surrounding column, labels outgrew their boxes and <foreignObject>
clipped the last glyph -- "Draft" came out as "Draf". The stylesheet
restates the body typography.
The highlight.js theme moves out of ChatView into markdownHighlight,
next to the plugin that emits the spans it colours: every other surface
was getting highlighted code only as long as the chat happened to be in
the module graph. Mermaid's own styles move to MermaidBlock.css for the
same reason. PlanView drops its private copy of the mermaid component
map.
Relative image paths in a reviewed doc still show alt text -- serving
them needs an fs-jailed asset route, which this does not add.