Grav-plugin-admin: Markdown editor problem

Created on 9 Jul 2018  路  3Comments  路  Source: getgrav/grav-plugin-admin

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:

  1. Download grav+admin.
  2. Run grav+admin on local machine (I'm using MAMP).
  3. Edit main content at the top of the page using code I've provided above.
  4. Check generated html.

Can you, please, confirm this is a bug or give an alternative advice ?

Thank you!

Most helpful comment

@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.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings