Python-Markdown / markdown

A Python implementation of John Gruber’s Markdown with Extension support.
https://python-markdown.github.io/
BSD 3-Clause "New" or "Revised" License
3.79k stars 863 forks source link

Regression in unescaping backslash in TOC title #1360

Closed oprypin closed 1 year ago

oprypin commented 1 year ago

Now I found another issue similar to #1358 and I checked that its fix doesn't also fix this one.

Regression in 3.4 - c0f6e5a31ea8e7fe98910a0523144c2a96fa9bf1 is the first bad commit

Reproduction code:

import markdown

md = markdown.Markdown(extensions=['toc'])
s = r'''
### hello \[foo]
'''
md.convert(s)
print(md.toc_tokens)

Output before vs after:

[{'level': 3, 'id': 'hello-foo', 'name': 'hello [foo]', 'children': []}]
[{'level': 3, 'id': 'hello-foo', 'name': 'hello \x0291\x03foo]', 'children': []}]
oprypin commented 1 year ago

For some background: I am finding these issues because I check MkDocs against a number of large sites to see if anything changed since its last release that wasn't supposed to. https://github.com/mkdocs/regressions/actions/runs/5592767284/jobs/10248820937#step:7:7770

The good thing is that I didn't see any other unwanted diffs in Markdown with this :)

And I'm running into these differences only now, because soon I will release MkDocs that finally un-pins the version of Markdown (and so will bring a lot of new users of the latest versions).

If you're planning to make a new release of this package, a release with these fixes soon would be really helpful :)

waylan commented 1 year ago

For some background:

Thanks for the background. I was wondering. In any event, we should be able to do a new release soon. I expect to have some more free time than usual next week so I'll aim for then,

waylan commented 1 year ago

@oprypin just thought you would like to know that we released version 3.4.4 today.