A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Python-Markdown/markdown/issues/1263 below:

PrettifyTreeprocessor stripping whitespace in `<pre><code>` · Issue #1263 · Python-Markdown/markdown · GitHub

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

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

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:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4