comments get printed on the UI by default
See original GitHub issueComment vs. strings
I believe that sreamlit is providing convenience by automatically writing the strings which are not assigned to any variable bu this is causing a trouble even comments are get written on the front end ui.
steps to reproduce: check this code
import streamlit as st
import pandas as pd
st.title('Streamlit Flaws')
st.subheader('Please Fix this')
"""
comment\n
should not be\n
printed\n
"""
def write_html(html):
st.markdown(html, unsafe_allow_html=True)
write_html("""
<!Doctype html>
<body>
<hr>
<h1>inside html</h1>
<h5>this string is fine</h5>
<p>when strings are enclosed inside these
```three quotation marks``` and passed as a parameter to a function they work as
string if they are directly written then they are treated as
comments do note the difference please.</p>
</body>
</html>
""")
Output
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Set default option for Print to NOT "Print Markup" while
I would like to set the default for printing to NOT have "Print Markup" checked. In other words, I don't want to print...
Read more >How can I fill the page when printing an MS word document ...
I have a word document with comments. I wanna print it with the comments, but when I try, the document and the comments...
Read more >Displaying Document Comments - Word Ribbon Tips
The latter method (using balloons) is the default comment-viewing method; there's nothing you need to do to turn it on.
Read more >Comment on prototypes – Figma Help Center
You can comment if you have at least can view access to the file and are ... You can choose to show or...
Read more >Print all comments on one page
I have a ten page pdf. this document has about a dozen comments scattered on ... The default options will print the comments...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for posting this. Was wondering why triple double-quote comments were being rendered. I thought triple single-quote comments should be allowed to render, but not triple double-quotes.
I think that what streamlit does is right because in a jupyter notebook if you type out only a docstring in a code cell, it shows the output.
Code
"""This is a docstring."""
Output
This is a docstring.
is rendered by a jupyter notebook as supposedly text to be printed and it displays it.