Skip to content
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

Tooltip should de-indent strings #3300

Closed
tvst opened this issue May 21, 2021 · 1 comment · Fixed by #3551
Closed

Tooltip should de-indent strings #3300

tvst opened this issue May 21, 2021 · 1 comment · Fixed by #3551
Assignees
Labels
good first issue Good for newcomers type:bug Something isn't working

Comments

@tvst
Copy link
Contributor

tvst commented May 21, 2021

Summary

When the entire string is indented in help=""""...""", the markdown processor marks the string as a code block. We should treat help the same way we treat st.markdown and st.write's input: by first calling textwrap.dedent(...) on it to remove global indentation.

Steps to reproduce

Code snippet:

st.text_input("Enter some text", help="""
    Hello world!
    """)

Expected behavior:

The tooltip should say:
Hello world!

Actual behavior:

The tooltip says:

Hello world!

(i.e. it wraps the text in a code block)

Is this a regression?

no

Debug info

  • Streamlit version: 0.81.0
@tvst tvst added type:bug Something isn't working good first issue Good for newcomers status:needs-triage Has not been triaged by the Streamlit team labels May 21, 2021
@kmcgrady kmcgrady removed the status:needs-triage Has not been triaged by the Streamlit team label May 23, 2021
@kmcgrady
Copy link
Collaborator

Totally a good idea and thank you @rbrishhabh for the PR. We will get to it this week!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type:bug Something isn't working
Projects
None yet
3 participants