CommonMark reads a comment that starts a line, after at most three spaces, as an HTML block. The block may span blank lines, and it takes the rest of the line that holds its closer, so a link after '<!-- c -->' at the start of a line is raw HTML, not a link. A comment inside a line is inline HTML, which cannot outlast its paragraph: past a blank line its opener is text, and a link before the later closer is real. The scan keeps the first closer and the first blank line after an opener while they stay valid, so it remains linear.