executablebooks / mdformat

CommonMark compliant Markdown formatter
https://mdformat.rtfd.io
MIT License
440 stars 46 forks source link

Header of GitHub issue templates gets messed up #372

Closed antazoey closed 1 year ago

antazoey commented 1 year ago

Describe the bug

context When I run mdformat

expectation I expected recognition of GitHub templates and to allow necessary formats to retain

bug But instead GitHub issue templates get messed up headers

problem This is a problem for people who have issue templates that they don't want messed up

Reproduce the bug

Have template that starts like:

---
name: Bug report
about: Report an error that you've encountered.
labels: 'category: bug'
---

and it will auto-format it to:

______________________________________________________________________

## name: Bug report about: Report an error that you've encountered. labels: 'category: bug'

List your environment

No response

welcome[bot] commented 1 year ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

hukkin commented 1 year ago

Hi!

The syntax you use is not CommonMark.

Quoting the readme file:

For full GitHub support do:

pip install mdformat-gfm mdformat-frontmatter mdformat-footnote
antazoey commented 1 year ago

This seems to work, except in pre-commit

antazoey commented 1 year ago

I probably need to add the deps to the precommit somehow

hukkin commented 1 year ago

The example in the docs shows how to use plugins with pre-commit https://mdformat.readthedocs.io/en/stable/users/installation_and_usage.html?highlight=pre-commit#usage-as-a-pre-commit-hook

gwpl commented 1 year ago

regarding pip install mdformat-gfm mdformat-frontmatter mdformat-footnote

just FYI how users may find your application.

I found is in AUR:

https://aur.archlinux.org/packages/mdformat

and that's how I installed it. So maybe good to add those other binaries there into software packages by default. 🤷🏻 - just idea 💡 (also posted there, and cross-linkling here: https://github.com/butler54/mdformat-frontmatter/issues/20 )