Hi @dataprofessor, thanks but I am getting this from an online chat API or from user input. I guess I can go through and cleanup the input but I was hoping there was a way to disable certain format rendering within the text method. Or to use a better font and word wrap for st.text.
Can you? You would have to deal with all Markdown syntax: square brackets for links, number symbols # for headers, pipes and dashes for tables, asterisks and (again) dashes for lists, numbers for numbered lists, allowed HTML tags (is there a list of them somewhere?), colons for emoji and colors…
st.text doesn’t do any formatting, it assumes the text is already formatted and displays it as is. For a better font I guess you can use CSS, but I would argue that for preformatted text monospaced fonts are better. For text wrapping use textwrap.
Thanks, I was starting to think that might become a bigger challenge than I expected… not always sure what content will be delivered from the api. Thanks for the tip on textwrap. Might get challenging since I am targeting desktop and mobile.
Thx for the response.
Unfortunately passing the rawstring with fR does not resolve the problem.
What is really strange for me is, that after the warning code and or comments are displayed in the terminal.
I noticed that it only happens when I have 2 $ signs in a f string
As soon as I add the next $ sign in my f string I get the weird formatting and need to escape every $ with the backslash.
This should really get fixed because it’s making chat output from GPT and other LLMs look buggy. It’s not a markdown standard to format with $, so why does Streamlit do it?