erusev / parsedown

Better Markdown Parser in PHP
https://parsedown.org
MIT License
14.69k stars 1.12k forks source link

Error showing the blockquote in code tags #792

Closed FilipSLO closed 3 years ago

FilipSLO commented 3 years ago
**_markup to show the output error:_**
******************************************
This markup should turn into blockquote within code tags:

> ```<script src="//some.website.org/js/"></script>
> ```

But doesn't.
******************************************

**_Actual output in version 1.8.0-beta-7:_**
******************************************
<p>This markup should turn into blockquote within code tags:</p>
<blockquote>
<pre><code class="language-<script"></code></pre>
</blockquote>
<p>But doesn't.</p>

**_Expected output:_**
******************************************
<p>This markup should turn into blockquote within code tags:</p>

<blockquote>
  <p><code>&lt;script src="//some.website.org/js/"&gt;&lt;/script&gt;</code></p>
</blockquote>

<p>But doesn't.</p>
taufik-nurrohman commented 3 years ago

Add new line after the first ```

> ```
> <script>
> ```
FilipSLO commented 3 years ago

Thanks, Taufik Nurrohman. Is that markdown invalid? Nice workaround BTW.

taufik-nurrohman commented 3 years ago

Yes, your code is invalid because any string right after the opening ``` or ~~~ will be treated as code class name to be used by syntax highlighter feature if any.

``` html
<script>
```