Skip to content

Conversation

@ashm-dev
Copy link
Contributor

Fixes #12986

@snyk-io
Copy link
Contributor

snyk-io bot commented Nov 20, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Image Critical Image High Image Medium Image Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@sfc-gh-bnisco sfc-gh-bnisco added feature:markdown Related to Markdown rendering change:bugfix PR contains bug fix implementation impact:users PR changes affect end users labels Nov 20, 2025
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 an issue where empty Markdown code blocks render as "undefined" instead of being empty. The fix processes the children prop to filter out "undefined" strings and handle null/empty values properly.

Key changes:

  • Made the children prop optional in the component interface
  • Added preprocessing logic to handle various children states (array, null, string, "undefined")
  • Simplified the copy button conditional rendering to use the processed text

@sfc-gh-bnisco sfc-gh-bnisco self-assigned this Nov 20, 2025
@ashm-dev
Copy link
Contributor Author

@sfc-gh-bnisco I'm not very good at front-end development. Could you review my PR?

@sfc-gh-bnisco sfc-gh-bnisco added the security-assessment-completed Security assessment has been completed for PR label Nov 21, 2025
Copy link
Collaborator

@sfc-gh-bnisco sfc-gh-bnisco left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution and iterations @ashm-dev! I made some updates and added tests.

Copy link
Contributor

@sfc-gh-nbellante sfc-gh-nbellante left a comment

Choose a reason for hiding this comment

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

Only 1 q, other than that LGTM 👍

@sfc-gh-bnisco sfc-gh-bnisco merged commit e902ded into streamlit:develop Nov 21, 2025
38 checks passed
@ashm-dev ashm-dev deleted the fix/md branch November 21, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:bugfix PR contains bug fix implementation feature:markdown Related to Markdown rendering impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Markdown rendering empty triple-backtick code fence adds the string "undefined"

3 participants