Remove supportHtml option from markdown rendering#318499
Draft
roblourens wants to merge 1 commit into
Draft
Conversation
…tent merging issues
Contributor
There was a problem hiding this comment.
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 (rawMarkdownToStringand its call sites). - Update
fillInIncompleteTokensOnceto operate on the last non-space/non-htmltoken and preserve any trailingspace/htmltokens. - 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
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.
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.