mdformat icon indicating copy to clipboard operation
mdformat copied to clipboard

Support markdownlint escape comments

Open hguturu opened this issue 9 months ago • 2 comments

Context

I am trying to use markdown lint and mdformat together. I was wondering if there was generally a way to make these two tools play better (e.g. share configurations).

Specifically, I am interested in support for lint escapes. E.g. I had a markdown

<!-- markdownlint-disable-next-line first-line-heading -->
Some content

I had the <!-- markdownlint-disable-next-line first-line-heading --> so the linter wouldn't complain about not heading line since the content is auto generated from an include. But mdformat introduces a newline and the linter no longer knows to skip the next line.

<!-- markdownlint-disable-next-line first-line-heading -->

Some content

Is there a way we can work around this?

Related, markdownlint allows custom globs for passing in markdown files that don't end in .md. I think running mdformat at the command line allows for passing in arbitrary files, but can something like that be added to the pre-commit hook as well?

Proposal

No response

hguturu avatar Mar 25 '25 22:03 hguturu

I would also welcome compatibility with markdownlint. It would be nice to not require a separate plugin for this.

mschoettle avatar May 20 '25 18:05 mschoettle

See also: https://github.com/hukkin/mdformat/issues/53

We could use separate comments for mdformat

s2t2 avatar Jun 20 '25 21:06 s2t2