An unterminated last line opens nothing, since a fence needs a line of its own.
whether the line opens a multiline math block
line to inspect