Closed
Description
Again this small code section markdown.treeprocessor.py:L432. I hope I'm not too annoying hitting these edge cases 😅
My element looks like this; it's a table where each line is wrapped in <pre><code>
.
<table>
<tbody>
<tr>
<td class="lineno">1</td>
<td><pre><code><span>def</span> <span>foo</span><span>()</span><span>:</span></code></pre></td>
</tr>
<tr>
<td class="lineno">2</td>
<td><pre><code> <span>return</span> <span>2</span></code></pre></td>
</tr>
</tbody>
</table>
which looks like this
1 def foo():
2 return 2
The Prettifier turns this into something like this
<table>
<tbody>
<tr>
<td class="lineno">1</td>
<td><pre><code>
<span>def</span> <span>foo</span><span>()</span><span>:</span></code></pre></td>
</tr>
<tr>
<td class="lineno">2</td>
<td><pre><code>
<span>return</span> <span>2</span></code></pre></td>
</tr>
</tbody>
</table>
which looks like this
1
def foo():
2
return 2
Looking at Babelmark only pandoc and Python-Markdown appears to be stripping whitespace in <pre><code>
, though fenced code isn't supported by default.
Possible fixes:
- Don't change anything, keep it as it is.
- Remove section.
- Don't prettify if
pre[0].text.isspace()
isTrue
(would fix my case).