We do whitespace stripping at the front/end of list items and headings.
Currently that stripping happens also *after HTML-style comments* at these locations. But that causes problems with the DSR representation, which only expects a single index to encode the positions of stripped whitespace, not an arbitrary list of widths caused by an arbitrary # of stripped HTML-style comments in the original wikitext source.
This feature is (probably? hopefully?) rarely used. We should lint out whitespace stripped after HTML comments, and then eventually remove that behavior from the spec, which would remove a case where the DSR information is inadequate to prevent a dirty diff.