"colon" in the st.button/st.chat_message cause issues


$ pip list | grep streamlit
streamlit                                1.36.0
streamlit-chat                           0.1.1

When I use code like st.button(":smile: explain more about os:cmd()"), cmd is not displayed, it is the same behavior in chat_message().

Are there any special way to escape it or encode it?

you can use the backslash before β€œ:” .

st.button(β€œ:smile: explain more about os\:cmd()”)

thx, later I noticed in github

there are other chars like \n, ".

All needs to be taken care of, escape is not elegant solution. But will be carefully to check those things.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.