List Block and Html Block Interaction Help

Confused… @mitty

Given

- <script>
- some text
some other text
</script>

and the reference output:

<ul>
<li>
<script>
</li>
<li>some text
some other text</li>
</ul>
</script>
  • line1: list block and html block start, generating <ul>\n<li>\n<script>
  • line 2: list item changes, ending the HTML block, generating </li>\n<li>some text
  • line 3: paragraph continuation, generating: \nsome other text

So, for me, the real question is what happens on line 4. At the time line 4 starts, there is an active list block and an active paragraph.

Option 1: (my implementation) The text on line 4 is tested for ability as an HTML block, and fails, as type 7s cannot break an existing paragraph. It then becomes normal text and inlines as Raw HTML. Then the end of document is hit, and both the paragraph and the list block close. Generates: \n</script></li>\n</ul>

Option 2: The text on line 4 causes the paragraph to close. This triggers the list to close as well as paragraph continuation is no longer in place. Then the processing of line 4 as a type 7 HTML block can proceed as it is not breaking a paragraph.

Option 3: The text on line 4 causes the list to close. This forces the paragraph closed. Then the processing of line 4 as a type 7 HTML block can proceed as it is not breaking a paragraph.

I am not sure if those are the only 3 options, but they are the only ones I can think of.

The reason this level of clarity is important to me is that to fix this issue properly, I feel that I need to understand why either Option 2 or Option 3 (or Option N where N > 3) is being used to form a correct response.

Just trying to understand, thanks for your patience!