hukkin / mdformat-gfm

Mdformat plugin for GitHub Flavored Markdown compatibility
MIT License
13 stars 2 forks source link

`mdformat-pelican` conflicts with `mdformat-gfm` #38

Closed kdeldycke closed 4 months ago

kdeldycke commented 6 months ago

A vanilla mdformat is messing with Pelican curly-braces variables and replacing them with % URL escape codes:

$ pipx install mdformat
(...)

$ mdformat --version
mdformat 0.7.17 (mdformat_web: 0.1.0)
$ cat ./test.md
![My photo]({attach}photo.jpg)
$ mdformat ./test.md
$ cat ./test.md
![My photo](%7Battach%7Dphoto.jpg)

That's why we have mdformat-pelican, and it works as expected:

$ pipx inject mdformat mdformat-pelican
  injected package mdformat-pelican into venv mdformat
done! ✨ 🌟 ✨

$ mdformat --version
mdformat 0.7.17 (mdformat_pelican: 0.1.0, mdformat_web: 0.1.0)
$ mdformat ./test.md
$ cat ./test.md
![My photo]({attach}photo.jpg)

Unformtunately, mdformat-pelican is not compatible with the addition of mdformat-gfm plugin:

$ pipx inject mdformat mdformat-gfm
  injected package mdformat-gfm into venv mdformat
done! ✨ 🌟 ✨

$ mdformat --version
mdformat 0.7.17 (mdformat_tables: 0.4.1, mdformat_gfm: 0.3.6, mdformat_pelican: 0.1.0, mdformat_web: 0.1.0)

$ mdformat ./test.md
Warning: Plugin conflict. More than one plugin defined a renderer for "link" syntax.

This has also been posted at: https://github.com/gaige/mdformat-pelican/issues/3

kdeldycke commented 6 months ago

A hackish fix has been proposed in: https://github.com/gaige/mdformat-pelican/pull/4

kdeldycke commented 4 months ago

A hack has been merged upstream into mdformat-pelican, so I guess this issue can be closed.