List inserted into middle of paragraph

I expect the following text (note newlines at the 80 character mark):

This worked for a few months. Unfortunately, occasionally a test would time
out and fail after 18 seconds - maybe 1 in 100 test runs would fail with a
timeout. Normally when the tests fail you get back some kind of error message
- a Postgres constraint failure will print a useful message, or a Javascript
exception will bubble up, or Javascript will complain about an unhandled
rejection.

when run through a markdown editor, to generate the following HTML:

<p>
This worked for a few months. Unfortunately, occasionally a test would time
out and fail after 18 seconds - maybe 1 in 100 test runs would fail with a
timeout. Normally when the tests fail you get back some kind of error message
- a Postgres constraint failure will print a useful message, or a Javascript
exception will bubble up, or Javascript will complain about an unhandled
rejection.
</p>

When I run it through cmark, I get the following:

<p>This worked for a few months. Unfortunately, occasionally a test would time
out and fail after 18 seconds - maybe 1 in 100 test runs would fail with a
timeout. Normally when the tests fail you get back some kind of error message</p>
<ul>
<li>a Postgres constraint failure will print a useful message, or a Javascript
exception will bubble up, or Javascript will complain about an unhandled
rejection.</li>
</ul>
<p>With this error we didn't get any of those. We also observed it could happen
anywhere - it didn't seem to correlate with any individual test or test file.</p>

Which seems incorrect - I definitely don’t want a list to begin in the middle of a paragraph. Is this a problem in the spec or is there something I can do differently to not trigger this behavior?

The spec defines this behavior

In CommonMark, a list can interrupt a paragraph. That is, no blank line is needed to separate a paragraph from a following list:

OK. Guessing there are no options to mitigate it?

Please see the thread

and comment there if you like.

1 Like