emvecchi commited on
Commit
eb77586
·
verified ·
1 Parent(s): 8e1e387

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -167,13 +167,13 @@ import html as py_html
167
  from streamlit.components.v1 import html as st_html
168
 
169
  def display_dialogue_with_numbers(text: str, title="Dialogue"):
170
- with st.expander(f"{title} (line numbers)", expanded=True):
171
  # optional: wrap long lines instead of horizontal scrolling
172
  st.markdown(
173
  "<style>.stCode pre {white-space: pre-wrap !important; word-break: break-word !important;}</style>",
174
  unsafe_allow_html=True,
175
  )
176
- st.code(text, language="text", line_numbers=True)
177
 
178
  def markdown_with_line_numbers(text: str, height: int = 500):
179
  # Number *source lines* (not wrapped visual lines)
 
167
  from streamlit.components.v1 import html as st_html
168
 
169
  def display_dialogue_with_numbers(text: str, title="Dialogue"):
170
+ with st.container(f"{title} (line numbers)", expanded=True):
171
  # optional: wrap long lines instead of horizontal scrolling
172
  st.markdown(
173
  "<style>.stCode pre {white-space: pre-wrap !important; word-break: break-word !important;}</style>",
174
  unsafe_allow_html=True,
175
  )
176
+ st.code(text, language="markdown", line_numbers=True)
177
 
178
  def markdown_with_line_numbers(text: str, height: int = 500):
179
  # Number *source lines* (not wrapped visual lines)