-
Notifications
You must be signed in to change notification settings - Fork 4k
Fix code usage in markdown labels #12175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it locally. Since the new expander icon is just a replacement of the arrow icon, it doesn't have any layout/visual impact.
sfc-gh-lwilby
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.