jackdewinter / pymarkdown

MIT License
74 stars 17 forks source link

MD032: add an option to forbid lazy continuation #979

Open papperlapapp opened 9 months ago

papperlapapp commented 9 months ago

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.
jackdewinter commented 7 months ago

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

papperlapapp commented 7 months ago

I'm not sure I understand your question. Adding an option to the existing rule just appeared natural to me. 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.

jackdewinter commented 7 months ago

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 commented 4 months ago

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.