-
Notifications
You must be signed in to change notification settings - Fork 887
Closed
Labels
bugBug report.Bug report.confirmedConfirmed bug report or approved feature request.Confirmed bug report or approved feature request.coreRelated to the core parser code.Related to the core parser code.
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 2The 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 2Looking 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).
Metadata
Metadata
Assignees
Labels
bugBug report.Bug report.confirmedConfirmed bug report or approved feature request.Confirmed bug report or approved feature request.coreRelated to the core parser code.Related to the core parser code.