erusev / parsedown-extra

Markdown Extra Extension for Parsedown
MIT License
822 stars 124 forks source link

Ignoring block HTML tags, if they immediately follow details/summary tag #137

Open otaj opened 5 years ago

otaj commented 5 years ago

Markdown seems to ignore block tag, if it is immediately following details/summary. On the other hand, it parses the content correctly, if first content after summary is markdown. Most likely related to #130


Incorrect case

Input

<details markdown="1">
<summary markdown="1">Details</summary>

<center markdown="1">
Centered text
</center>
</details>

Output

<details>
<summary>
<p>Details</p>
</summary>
</details>

Expected output

<details>
<summary>
<p>Details</p>
</summary>
<center>
<p>Centered text</p>
</center>
</details>

Correct case

Input

<details markdown="1">
<summary markdown="1">Details</summary>

- List item
- Some other item

<center markdown="1">
Centered text
</center>
</details>

Output (which is correct)

<details>
<summary>
<p>Details</p>
</summary>
<ul>
<li>List item</li>
<li>Some other item</li>
</ul>
<center>
<p>Centered text</p>
</center>
</details>
panthonies commented 4 years ago

If anyone looking for a workaround: Wrap the contents inside of the details with <p markdown="block"></p>, and remove markdown="1" from the details and summary tags.

Example: For the first case given above, the input code below produces the correct output code:

<details>
<summary>Details</summary><p markdown="block">

<center markdown="1">
Centered text
</center>
</p></details>