var findEndOfMath=function(delimiter,text,startIndex){var index=startIndex;var braceLevel=0;var delimLength=delimiter.length;while(index