Skip to content

Remove supportHtml option from markdown rendering#318499

Draft
roblourens wants to merge 1 commit into
mainfrom
roblou/agents/cherry-pick-db96a5b-no-commit
Draft

Remove supportHtml option from markdown rendering#318499
roblourens wants to merge 1 commit into
mainfrom
roblou/agents/cherry-pick-db96a5b-no-commit

Conversation

@roblourens
Copy link
Copy Markdown
Member

Eliminate the supportHtml option in markdown rendering to resolve content merging issues. This change ensures proper handling of markdown tokens, particularly in scenarios where content is wrapped in HTML tags. Additional tests verify that the rendering behaves correctly without the supportHtml option.

Copilot AI review requested due to automatic review settings May 27, 2026 03:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes reliance on supportHtml when constructing chat markdown content and adjusts the markdown token “fix-up” logic so it still works when markdown is wrapped in <body>...</body> (which produces trailing html tokens). The goal is to prevent rendering/content-merging problems while keeping streaming “incomplete token” recovery working.

Changes:

  • Stop passing { supportHtml: true } through the agent-host → chat progress/history markdown conversion path (rawMarkdownToString and its call sites).
  • Update fillInIncompleteTokensOnce to operate on the last non-space/non-html token and preserve any trailing space/html tokens.
  • Add regression tests covering codespan completion both at the base markdown-renderer level and in the chat markdown renderer.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/browser/widget/chatMarkdownRenderer.test.ts Adds a chat-level regression test ensuring incomplete codespans are closed even when markdown is rendered with supportHtml wrapping behavior.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/stateToProgressAdapter.ts Removes supportHtml plumbing from rawMarkdownToString and updates call sites accordingly.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts Stops emitting streamed markdown deltas with { supportHtml: true }.
src/vs/base/test/browser/markdownRenderer.test.ts Adds a unit test to validate codespan fix-up when the final token is trailing html (</body>).
src/vs/base/browser/markdownRenderer.ts Fixes fillInIncompleteTokensOnce to skip trailing space/html tokens so paragraph/list fixups still apply, while preserving the skipped trailing tokens.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants