jonschlinkert / remarkable

Markdown parser, done right. Commonmark support, extensions, syntax plugins, high speed - all in one. Gulp and metalsmith plugins available. Used by Facebook, Docusaurus and many others! Use https://github.com/breakdance/breakdance for HTML-to-markdown conversion. Use https://github.com/jonschlinkert/markdown-toc to generate a table of contents.
https://jonschlinkert.github.io/remarkable/demo/
MIT License
5.74k stars 371 forks source link

Convert list without <p> tag #384

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi,

If you put

- something
- another thing

you get <li><p>something</p></li> Can you convert lists without paragraph mark instead when it's needed.

Dagur commented 4 years ago

I'm also having problems with lists and <p> tags

This

* One
* Two
    * Three
* Four
* Five

gives me

<ul>
<li>One</li>
<li>Two
<ul>
<li>Three</li>
</ul></li>
<li>Four</li>
<li>Five</li>
</ul>

but if I add one newline between

* One
* Two
    * Three

* Four
* Five

I get this

<ul>
<li><p>One</p></li>
<li><p>Two</p>
<ul>
<li>Three</li>
</ul></li>
<li><p>Four</p></li>
<li><p>Five</p></li>
</ul>

Adding another newline removes the <p> tags again

ghost commented 4 years ago

<p> must put only when you have more than one line. Ex:

* One
* Two
    This is another line. It has 4 spaces
* Three

Should get:

...
<li><p>Two</p><p>This is another line. It has 4 spaces</p></li>
<li>Three</li>
...