blackfriday icon indicating copy to clipboard operation
blackfriday copied to clipboard

Parse error: If list item followed by a code block

Open branchvan opened this issue 4 years ago • 1 comments

The source markdown code is:

- This is a demo list item
  
  ```shell
  $ service ssh status
  $ service ssh start
  (There should be three '`', however it leads parse error of the github's markdown parser)

And it would be parsed to:

<ul>
  <li>
    <p>This is a demo list item</p>
    <div class="highlight">
      <pre class="chroma">
        <code class="language-shell" data-lang="shell">
          $ service ssh status
          $ service ssh start
        </code>
      </pre>
    </div>
  </li>
</ul>

This problem also happen when using ordered list.

However, if I add some text between list item and code block, like this:

- This is a demo list item

  test
  
  ```shell
  $ service ssh status
  $ service ssh start
  (There should be three '`', however it leads parse error of the github's markdown parser)

And the parsed result is:

<ul><li>This is a demo list item</li></ul>
<p>test</p>
<div class="highlight"><pre class="chroma"><code class="language-shell" data-lang="shell"> 
$ service ssh status
$ service ssh start</code></pre></div>

Anyone know how to fix it?

branchvan avatar Oct 30 '19 13:10 branchvan

Could this be caused by this line calling block instead of inline func?

jasinner avatar Aug 12 '20 05:08 jasinner