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.

Nested list with st.markdown

See original GitHub issue

Hi, As unbelievable as it is, I couldn’t create a nested list using st.markdown. Here is the most basic I tried:

- A
  - a
- B 

which should yield:

  • A
    • a
  • B

, but instead gives a flat list. Neither one space, nor two spaces, tab key, or \t worked. A minimal working example is highly appreciated.

Many thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
aghasemicommented, Nov 12, 2020

I get it now. So this works:

"""
* Fruit
  * Apple
* Orange
  * Banana
* Dairy
  * Milk
* Cheese
"""

, but this doesn’t:

 "* Fruit"
 "  * Apple"
 "* Orange"
 "  * Banana"

It means one cannot dynamically/programmatically create lists (not easily at least). One solution is to generate the string dynamically and then write it at once. The other way is to use unsafe HTML.

Many thanks Best

1reaction
aghasemicommented, Nov 12, 2020

Many thanks. I totally agree that there is room for improvement here.

For now, I solved my problem by generating a string dynamically and then feeding it to st.markdown at once.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Markdown Tutorial - Nested Lists - CommonMark
To nest one list within another, indent each item in the sublist by four spaces. You can also nest other elements like paragraphs,...
Read more >
Developers - Nested list with st.markdown - - Bountysource
Hi, As unbelievable as it is, I couldn't create a nested list using st.markdown . Here is the most basic I tried:
Read more >
How to markdown nested list items in Bitbucket?
I'm trying to see my markdown nested list items rendered with corresponding indentation when viewed in a browser live from the Bitbucket ...
Read more >
How to write nested numbered lists - Meta Stack Exchange
@Arjan Well, Markdown supports nested lists, but I don't think it supports a way to change their type; the only type you can...
Read more >
How To Do Nested List In Markdown? – What Is Mark Down
To create a nested list in markdown, you will need to use a combination of list items and sub-list items. List items are...
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