redcarpet icon indicating copy to clipboard operation
redcarpet copied to clipboard

paragraphs inserted by renderer when two separate lists are created with an empty space between them

Open chuckixia opened this issue 4 years ago • 3 comments

If you put the following block of mardown text in redcarpet

# BLABLABLA
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed adsasdfadfadsfadsf

Something something the secret to life is 42:

* Stage you do the thing
* you do the other thing but for some reason you are a paragraph now.

* There was a deliberate empty space above.
* I am feeling a little weird. bugs

you get

<h1>BLABLABLA</h1>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed adsasdfadfadsfadsf</p>

<p>Something something the secret to life is 42:</p>

<ul>
<li>Stage you do the thing</li>
<li><p>you do the other thing but for some reason you are a paragraph now.</p></li>
<li><p>There was a deliberate empty space above.</p></li>
<li><p>I am feeling a little weird. bugs</p></li>
</ul>

Notice after the first list item all of a sudden P tags appear. This is called from the paragraph method of class Redcarpet::Render::Base .

markdownlivepreview.com renders a single unordered list. If you use an ordered list, it should render a single ordered list.

I know this looks like it's inconsequential for HTML, but for other renders it can really mess up parsing.

chuckixia avatar Apr 14 '20 14:04 chuckixia