I'm having some trouble displaying simple lists in page content.
I'm trying to use:
* A
* B
# Heading
1. B
2. C
Result: this creates one list that contains heading and another list that is put into first list.
Expected: unordered list, heading, ordered list.
Steps to reproduce:
Can you, please, confirm this is a bug or give an alternative advice ?
Thank you!
This is a Markdown issue rather than a grav-admin one.
I suggest you add empty lines around the heading, like so. Markdown uses blank lines to separate the text into paragraphs and other independent blocks. Without these, Parsedown understood your heading as in the previous block; that's why it was in the bullet list.
* A
* B
# Heading
1. B
2. C
@AmauryCarrade Tried it. Didn't work.
@AmauryCarrade's code is correct, as the initial code - without empty lines, renders as:
<ul>
<li>A</li>
<li>B
<h1>Heading</h1>
<ol>
<li>B</li>
<li>C</li>
</ol></li>
</ul>
But Amaury's renders as:
<ul>
<li>A</li>
<li>B</li>
</ul>
<h1>Heading</h1>
<ol>
<li>B</li>
<li>C</li>
</ol>
Tested with Parsedown, what Grav uses to parse Markdown, and with Grav v1.5.0-beta.1 + Admin v1.8.5. Make sure your cache is disabled for development, and cleared.
Most helpful comment
@AmauryCarrade's code is correct, as the initial code - without empty lines, renders as:
But Amaury's renders as:
Tested with Parsedown, what Grav uses to parse Markdown, and with Grav v1.5.0-beta.1 + Admin v1.8.5. Make sure your cache is disabled for development, and cleared.