re #346: Fix problem parsing some LaTeX math expressions.

The primary symptom was that equations that had just been edited
using the WIRIS plugin would no longer be detectable by the WIRIS
plugin.

The problem was caused by a simple typo in the delimiter matching.
Specifically, the use of the intermediate variable...

    var position = delimiterMatch.position;

...was inconsistent; when `delimiterMatch` was reset later in the function,
`position` was not being updated from the new value.

(I've retained the intermediate variables I introduced whilst debugging
because they slightly improve readability and will help with any
future extension or debugging of that code.)