Incomplete outline in notes with latex

In a quick test, this breaks, i.e., doesn’t show the following headings in the Outline tab:

> comment
> $$
  \begin{vmatrix}a & b\\ c & d \end{vmatrix}=ad-bc 
  $$

The headings are fine using this, but you end up with an unwanted > in the math block.

> comment
> $$
  \begin{vmatrix}a & b\\ c & d \end{vmatrix}=ad-bc 
> $$

These seem working and the headings are fine:

> comment $$\begin{vmatrix}a & b\\ c & d \end{vmatrix}=ad-bc$$

> comment
> $$
  \begin{vmatrix}a & b\\ c & d \end{vmatrix}=ad-bc$$

Related: