Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@tamuratak
Copy link
Contributor

@tamuratak tamuratak commented Nov 12, 2025

fix: use childNodes instead of children in DOM.reset for markdown rendering. Fix #266103

Might be related to #273617.

Before:

image

After:

image

CC: @mjbvz

Copilot AI review requested due to automatic review settings November 12, 2025 10:59
@vs-code-engineering
Copy link

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@bpasero

Matched files:

  • src/vs/base/browser/markdownRenderer.ts

Copy link
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 fixes a bug in markdown rendering where text nodes were being lost when a target element was provided. The issue occurred because the code was using .children (which only returns element nodes) instead of .childNodes (which returns all nodes including text).

  • Changed DOM.reset(target, ...renderedContent.children) to use childNodes instead of children

Copy link
Collaborator

@mjbvz mjbvz left a comment

Choose a reason for hiding this comment

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

Thanks! Makes sense since our sanitizer converts the html to normal text nodes

@mjbvz mjbvz added this to the November 2025 milestone Nov 12, 2025
@mjbvz mjbvz merged commit 7a72b4d into microsoft:main Nov 13, 2025
22 of 23 checks passed
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.

HTML tags are stripped from user messages in Chat

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.