getpelican / pelican

Static site generator that supports Markdown and reST syntax. Powered by Python.
https://getpelican.com
GNU Affero General Public License v3.0
12.61k stars 1.81k forks source link

`/`` (backtick) gets transformed from MarkDown to <code>96</code> in HTML (and breaks the Atom feed) #3412

Closed silverhook closed 3 weeks ago

silverhook commented 1 month ago

TL;DR:

suddenly

`\``

gets translated to

<code>96</code>

instead of (as before):

<code>`</code>

and causes issues.


Since I updated Pelican recently, I started running into this issue, so I suspect it is a regression of either Pelican itself or the Python Markdown module.

Suddenly this blog post of mine from 2014 started causing causing issues – specifically the 4th footnote in it: https://matija.suklje.name/delete-a-sentence-in-vim#fn:q

What happens is that the following Markdown (added linebreak for easier reading):

[^q]: `di"` to delete the text inside quotation marks; and `da"` to delete outside the quotation mark
(to remove surrounding quotations marks as well). Also works with `'` and `\``.

gets translated to HTML as (added linebreaks for easier reading):

<p><code>di"</code> to delete the text inside quotation marks; and <code>da"</code> to delete outside the quotation mark
 (to remove surrounding quotations marks as well). Also works with <code>'</code> and <code>96</code>.&#160;<a
 class="footnote-backref" href="[#fnref:q](view-source:https://matija.suklje.name/delete-a-sentence-in-vim#fnref:q)" 
title="Jump back to footnote 4 in the text">&#8617;</a></p>

As an additional consequence (and this is how I found out through a subscriber) the Atom feed gets broken, see the following two as the broken ones:

vs. those who still work:

mart-e commented 3 weeks ago

Hi,

It’s weird it worked before because your example code doesn’t seem to produce an escaped backtick in markdown but three backticks. You can try here on github for instance:

`\``

produces : ```

I believe the correct syntax is:

Also works with `'` and `` ` ``
silverhook commented 3 weeks ago

This worked, thanks! :D