Closed ghost closed 2 years ago
Can you post a minimal reproducible example? It looks like you posted some results, but I can only guess as to how we got there if I don't have the source before it was parsed, and the minimal extensions required to cause the issue.
Have you enabled the fenced_code extension? Without the the source, its hard to tell for sure, but the output looks like something you might get if the extension is not enabled.
On my end, a simple fenced code block gets converted to HTML under a <p><code>...</code>
, instead of <pre>...</pre>
, which seems wrong. Turning on fenced_code
does "fix" it, but it results in the code-block contents being placed in a <pre><code>...</code></pre>
, and I am pretty sure that <code>
is superfluous.
IMO, with or without an extension, a fenced code block should go into <pre>
(or perhaps not be treated specially at all – but putting it into <code>
seems to make very little sense), and if the extension is on, the <code>
should not get added.
On my end, a simple fenced code block gets converted to HTML under a
<p><code>...</code>
, instead of<pre>...</pre>
, which seems wrong. Turning onfenced_code
does "fix" it, but it results in the code-block contents being placed in a<pre><code>...</code></pre>
, and I am pretty sure that<code>
is superfluous.
This is inline with how things are described in the HTML5 spec, so this won't be changing: https://www.w3.org/TR/2011/WD-html5-author-20110809/the-pre-element.html.
IMO, with or without an extension, a fenced code block should go into
<pre>
(or perhaps not be treated specially at all – but putting it into<code>
seems to make very little sense), and if the extension is on, the<code>
should not get added.
Standard Markdown, as described here, does not include fenced code blocks, that is non-standard; therefore, it is included via extensions, that also is not changing.
Also, this issue seems to be stale and can probably be closed at this point.
I see. Thanks for the references – I wasn't aware. Makes sense.
I have a code block that is not converting properly. The code block becomes this
I think all the code should be in the