Files
John MacFarlane b57d3f9b4d Markdown writer: better handling of pandoc-generated code blocks.
Omit the wrapper sourceCode divs added by pandoc around code blocks.

More intelligently identify which class to use for the one class
allowed in GFM code blocks.  If there is a class of form `language-X`,
use `X`; otherwise use the first class other than `sourceCode`.

Closes #10926.
2025-06-20 13:42:31 -07:00

513 B

% pandoc -f html -t gfm
<div class="sourceCode" id="cb1"><pre
class="sourceCode ruby"><code class="sourceCode ruby"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">test</span></span></code></pre></div>
^D
``` ruby
test
```
% pandoc -f html -t gfm
<pre
class="border language-ruby"><code class="sourceCode ruby"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">test</span></span></code></pre>
^D
``` ruby
test
```