question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

comments get printed on the UI by default

See original GitHub issue

Comment 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

strm

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
pybokehcommented, Oct 28, 2019

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.

0reactions
khanfarhan10commented, Nov 6, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found