Fix code usage in markdown labels#12175
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
✅ PR preview is ready!
|
| code_block = """ | ||
|
|
||
| ```python | ||
| print('I am hopelessly, breathlessly, madly in love with Streamlit—the smooth-talking, curve-hugging seductress of \ |
Oh yeah good question – I guess we just looked at inline code back then and didn't really think about code blocks. But agree that it doesn't make sense to change this now... |
| ``` | ||
|
|
||
| """ | ||
| st.expander("With code block:\n" + code_block) |
There was a problem hiding this comment.
Should we add a test with the code block and an icon? Or maybe it is enough to just test locally?
There was a problem hiding this comment.
Tested it locally. Since the new expander icon is just a replacement of the arrow icon, it doesn't have any layout/visual impact.
Describe your changes
Using markdown code blocks in labels can lead to overflowing the parent boundaries. This is especially the case for expander label:
There is another related discussion: why do we even allow full code blocks in markdown labels? However, it looks like we have been allowing that for a long time -> so lets fix it for now.
GitHub Issue Link (if applicable)
labelmakest.expandercriminally ugly #12149Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.