function math_block(state, start, end, silent){
                    var firstLine, lastLine, next, lastPos, found = false, token,
                        pos = state.bMarks[start] + state.tShift[start],
                        max = state.eMarks[start]

                    if(pos + 2 > max){ return false; }
                    if(state.src.slice(pos,pos+2)!=='$$'){ return false; }

                    pos += 2;
                    firstLine = state.src.slice(pos,max);

                    if(silent){ return true; }
                    if(firstLine.trim().slice(-2)==='$$'){
                        // Single line expression
                        firstLine = firstLine.trim().slice(0, -2);
                        found = true;
                    }

                    for(next = start; !found; ){

                        next++;

                        if(next >= end){ break; }

                        pos = state.bMarks[next]+state.tShift[next];
                        max = state.eMarks[next];

                        if(pos < max && state.tShift[next] < state.blkIndent){
                            // non-empty line with negative indent should stop the list:
                            break;
                        }

                        if(state.src.slice(pos,max).trim().slice(-2)==='$$'){
                            lastPos = state.src.slice(0,max).lastIndexOf('$$');
                            lastLine = state.src.slice(pos,lastPos);
                            found = true;
                        }

                    }

                    state.line = next + 1;

                    token = state.push('math_block', 'math', 0);
                    token.block = true;
                    token.content = (firstLine && firstLine.trim() ? firstLine + '\n' : '')
                        + state.getLines(start + 1, next, state.tShift[start], true)
                        + (lastLine && lastLine.trim() ? lastLine : '');
                    token.map = [ start, state.line ];
                    token.markup = '$$';
                    return true;
                }
The main Settings object

The current options stored are:
 - displayMode: Whether the expression should be typeset by default in
                textstyle or displaystyle (default false)