Skip to content

fix(MD013): keep reflow from moving text off lines exempted from other rules - #1007

Merged
rvben merged 1 commit into
rvben:mainfrom
56steve:fix-reflow-line-scoped-disable
Nov 17, 2026
Merged

rvben merged 1 commit into
rvben:mainfrom
56steve:fix-reflow-line-scoped-disable

Conversation

@56steve

@56steve 56steve commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

With reflow on, rumdl fmt wrapped a long line that carries a disable-next-line or disable-line comment for another rule, for example MD033. The tail of the line moved onto a line the comment does not cover, so <b>x</b> was reported by MD033 right after the format.

The paragraph fix is now withheld when a line it would rewrite has a line-scoped directive for any rule, the same way it already is for MD013's own disabled lines. Block disable/enable regions are unaffected and still reflow.

The new test covers next-line, disable-line and markdownlint-style comments, a paragraph with a following line, and a control with a region that still rewraps. Side effect: such a paragraph keeps its MD013 warning with no auto-fix.

Fixes #1002

A paragraph with a disable-line or disable-next-line directive for
another rule (MD033, MD034, ...) was still rewrapped, which moved part of
the exempted line onto a line the directive does not cover. The reflow
fix is now withheld when any line it rewrites carries a line-scoped
directive, as it already is for MD013's own disabled lines.
@rvben
rvben merged commit f0d9004 into rvben:main Nov 17, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fmt with reflow moves text out of reach of a disable-next-line comment for another rule

2 participants