Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/cli/src/ui/utils/MarkdownDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,12 @@ const MarkdownDisplayInternal: React.FC<MarkdownDisplayProps> = ({
if (!text) return <></>;

const renderVisualBlocks = renderMode === 'render';
const lines = text.split(/\r?\n/);
// Some models stream long runs of trailing newlines after useful content.
// Trim them from the live preview so blank rows do not push stable streaming
// text into scrollback on every repaint. The committed transcript still
// renders the full message via MarkdownDisplay with isPending=false.
const displayText = isPending ? text.trimEnd() : text;
const lines = displayText.split(/\r?\n/);
const headerRegex = /^ *(#{1,4}) +(.*)/;
const codeFenceRegex = /^ *(`{3,}|~{3,}) *([^`]*)$/;
const ulItemRegex = /^([ \t]*)([-*+]) +(.*)/;
Expand Down
Loading