Indented HTML in list

Could anybody tell me why HTML interrupts here:

- list
  <!--
-->

but not here:

- list
  <!--
  -->

As an opposite example, here:

- list
  text
text

where all is in list.