mdformat icon indicating copy to clipboard operation
mdformat copied to clipboard

Wrapping of badge lines

Open LecrisUT opened this issue 1 year ago • 0 comments

Describe the bug

context I was adding badges in this PR, and the project's pre-commit (which uses mdformat, don't know which version) was suggesting a change like:

- [![Release Status][release-badge]][release-link]
- [![Fedora Status][fedora-badge]][fedora-link]
+ [![Release Status][release-badge]][release-link] [![Fedora Status][fedora-badge]][fedora-link]                
[![Spack Status][spack-badge]][spack-link] 

Probably because --wrap=100 is used.

expectation

For badge lines it would make more sense to keep them as individual lines to better support git navigation.

It would be nice to have a way to disable this formatting for specific sections. Like # format: off

Reproduce the bug

mdformat --wrap 100 on:

[![Release Status][release-badge]][release-link]
[![Fedora Status][fedora-badge]][fedora-link]
[![Spack Status][spack-badge]][spack-link]

[fedora-badge]: https://img.shields.io/fedora/v/cp2k
[fedora-link]: https://src.fedoraproject.org/rpms/cp2k
[release-badge]: https://img.shields.io/github/v/release/cp2k/cp2k
[release-link]: https://github.com/cp2k/cp2k/releases
[spack-badge]: https://img.shields.io/spack/v/cp2k
[spack-link]: https://packages.spack.io/package.html?name=cp2k

LecrisUT avatar Apr 24 '24 11:04 LecrisUT