Superfences stopped working on python 3.10, pymdown-extensions 9.5 #1741
-
I was moving some work to a new machine and noticed that superfences stopped working on it. The major difference is the new machine is using Ubuntu Server 22.04 w/ python 3.10 and pymdown-extensions 9.5, and the old machine was using Ubuntu 20.04 w/ python 3.8 and pymdown-extensions 9.1. Everything else looks the same, but superfences doesn't seem to work at all. import markdown
html = 'hi\n\n'
html += 'try https://google.com for `code` examples.\n\n'
html += '``` python\nimport markdown\n```\n\n'
html += '```{.python .extra-class #id linenums="1"}\nimport hello_world\n```\n\n'
html += 'bye\n\n'
md = markdown.Markdown(extensions=['pymdownx.superfences', 'attr_list', 'pymdownx.magiclink'])
print(md.convert(html)) <p>hi</p>
<p>try <a href="https://google.com">https://google.com</a> for <code>code</code> examples.</p>
<p><code>python
import markdown</code></p>
<p><code>{.python .extra-class #id linenums="1"}
import hello_world</code></p>
<p>bye</p> Note the magiclinks are working correctly, but the code blocks are behaving like inline code blocks and output the same as if converted w/o superfences like FWIW, this is how the old machine outputs the same input: <p>hi</p>
<p>try <a href="https://google.com">https://google.com</a> for <code>code</code> examples.</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">markdown</span>
</code></pre></div>
<table id="id" class="extra-class highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div class="extra-class highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">hello_world</span>
</code></pre></div>
</td></tr></table>
<p>bye</p> Any help appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I haven't looked too closely at this yet, but make sure Pygments is updated to the latest as well. Pygments changed some things and pymdown-extensions requires an updated pygments. The output may be a little different, but should work. |
Beta Was this translation helpful? Give feedback.
I haven't looked too closely at this yet, but make sure Pygments is updated to the latest as well. Pygments changed some things and pymdown-extensions requires an updated pygments. The output may be a little different, but should work.