executablebooks / MyST-Parser

An extended commonmark compliant parser, with bridges to docutils/sphinx
https://myst-parser.readthedocs.io
MIT License
708 stars 189 forks source link

replacement of "." in headings for slugs #908

Open dkuegler opened 3 months ago

dkuegler commented 3 months ago

What version of myst-parser are you using?

2.0.0

What version dependencies are you using?

Sphinx 7.2.6

What operating system are you using?

Linux

Describe the Bug

Anchors are generated differently in Myst parser and GitHub markdown parsers. Specifically, # Ubuntu 20.04 gets the anchor ubuntu-2004 on GitHub, but ubuntu-20-04 by Myst parser

Expected Behavior

Same anchor as GitHub.

To Reproduce

See above

chrisjsewell commented 2 months ago

Same anchor as GitHub.

Well thats the difficulty; github doesn't have good specifications for its syntaxes 😒

But actually I have written an entire slugger in rust recently 😉 : https://github.com/markdown-it-rust/markdown-it-plugins.rs/tree/main/crates/github_slugger