pymarkdown icon indicating copy to clipboard operation
pymarkdown copied to clipboard

MD032: add an option to forbid lazy continuation

Open papperlapapp opened this issue 1 year ago • 4 comments

The CommonMark spec allows lazy continuation lines in lists, e.g.

1.  A paragraph
with two lines.

and pymarkdown is currently happy with these.

I'd rather prefer to have an option to disable this, e.g. require my users to write the above as

1.  A paragraph
    with two lines.

papperlapapp avatar Feb 03 '24 13:02 papperlapapp

This is probably doable as a rule, any kind of fix support would take longer. Does that work for you?

jackdewinter avatar Mar 19 '24 02:03 jackdewinter

I'm not sure I understand your question. Adding an option to the existing rule just appeared natural to be. From a user's perspective, I don't see a difference between an option to an existing rule or a separate rule. The results of both would be identical.

Interestingly (and FWIW), the MD032 rule in https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md032---lists-should-be-surrounded-by-blank-lines forbids lazy continuation lines.

papperlapapp avatar Mar 24 '24 07:03 papperlapapp

Interesting... its has changed since I last look at it.

I am leaning towards a new rule, as it is clearer to the user. Reading that rule, it seems to be more of a "side effect" instead of an intended behavior. Its one the list... it should be relatively easy to implement and test.

jackdewinter avatar Mar 30 '24 01:03 jackdewinter

Btw, just coming across a lot of these in our current testing of triply nested containers. Thinking that we might have time to work on this before the end of this next month. Stay tuned.

jackdewinter avatar Jul 13 '24 17:07 jackdewinter