Repository navigation
fix(MD013): keep reflow from moving text off lines exempted from other rules - #1007
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With reflow on,
rumdl fmtwrapped a long line that carries adisable-next-lineordisable-linecomment 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/enableregions 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