russross / blackfriday

Blackfriday: a markdown processor for Go
Other
5.41k stars 596 forks source link

Buggy, fragile list behavior #701

Open soypat opened 1 year ago

soypat commented 1 year ago

Using blackfriday v2.1.0, default parameters

The following markdown has 3 list items.

7. Defina
    ```python
    > greet_user("esteban")
  1. Dado

    resultado = simple()
  2. Examine

    def convertir_a_float(cadena):
Here is the html result. Some observations:
* It unexpectedly nests a list
* Second item code is inline, inconsistent with other code blocks (and unexpected

<details>

```html
<ol>
<li><p>Defina</p>

<pre><code class="language-python">&gt; greet_user(&quot;esteban&quot;)
</code></pre>
<ol>
<li>Dado
<code>python
resultado = simple()
</code></li>
</ol></li>

<li><p>Examine</p>

<pre><code class="language-python">def convertir_a_float(cadena):
</code></pre></li>
</ol>

If we remove the third item from the markdown list we get the following. Few observations:

```html
  1. Defina python > greet_user("esteban") 11. Dado python resultado = simple()
```

Something similar happens if we delete the first item of the list.

```html
  1. Dado python resultado = simple() 12. Examine python def convertir_a_float(cadena):
```

Please note the tabs in front of the code blocks have no effect on the bug.