It does a second check to see if there are more opening dollar signs than
closing and then passes those through a function that walks the list of broken
math elements and detects the opening elements that aren't paired with closing
elements (by confirming that the pairs are adjacent). The opening elements that
aren't paired are excluded from the list and then if the list is still not
balanced an error is thrown.
This adds a stronger solution to #121.
It does a second check to see if there are more opening dollar signs than closing and then passes those through a function that walks the list of broken math elements and detects the opening elements that aren't paired with closing elements (by confirming that the pairs are adjacent). The opening elements that aren't paired are excluded from the list and then if the list is still not balanced an error is thrown.