-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
feature:markdownRelated to Markdown renderingRelated to Markdown renderingfeature:st.codeRelated to the `st.code` elementRelated to the `st.code` elementpriority:P3Medium priorityMedium prioritystatus:confirmedBug has been confirmed by the Streamlit teamBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expectedSomething isn't working as expected
Description
Checklist
- I have searched the existing issues for similar issues.
- I added a very descriptive title to this issue.
- I have provided sufficient information below to help reproduce this issue.
Summary
Markdown rendering empty triple-backtick code fence adds the string "undefined".
Minimum example:
import streamlit as st
st.markdown("""
Hello
Has content:
```
some_content
```
Is empty, this one is the problem:
```
```
End
""")
Renders like so:
But would expect to have an empty code area, not a code area with the string "undefined" in it.
Reproducible Code Example
import streamlit as st
st.markdown("""
Hello
Has content:
some_content
Is empty, this one is the problem:
End
""")Steps To Reproduce
- Create the above streamlit
app.py - Run it
Expected Behavior
Expect the empty triple-backtick code fence with nothing in it to show just an empty grey rectangle.
Current Behavior
Currently the empty triple-backtick code fence with nothing in it to shows a grey rectangle with the string "undefined".
Is this a regression?
- Yes, this used to work in a previous version.
Debug info
- Streamlit version: 1.51.0
- Python version: 3.10.19
- Operating System: Ubuntu 24.04.3 LTS
- Browser: Chrome
Additional Information
No response
github-actions
Metadata
Metadata
Assignees
Labels
feature:markdownRelated to Markdown renderingRelated to Markdown renderingfeature:st.codeRelated to the `st.code` elementRelated to the `st.code` elementpriority:P3Medium priorityMedium prioritystatus:confirmedBug has been confirmed by the Streamlit teamBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expectedSomething isn't working as expected