1
0
Fork 0

render unclosed display block

This commit is contained in:
Waylon Flinn 2016-04-22 11:59:42 -05:00
parent 2a45cb8b71
commit 152877dc41

View file

@ -88,23 +88,26 @@ function math_block(state, start, end, silent){
found = true; found = true;
} }
for(next = start; next < end; ){ for(next = start; !found; ){
if(found){ break; }
next++; next++;
if(next >= end){ break; }
pos = state.bMarks[next]+state.tShift[next]; pos = state.bMarks[next]+state.tShift[next];
max = state.eMarks[next]; max = state.eMarks[next];
if(pos < max && state.tShift[next] < state.blkIndent){ if(pos < max && state.tShift[next] < state.blkIndent){
// non-empty line with negative indent should stop the list:
break; break;
} }
if(state.src.slice(pos,max).trim().slice(-2)==='$$'){ if(state.src.slice(pos,max).trim().slice(-2)==='$$'){
lastPos = state.src.slice(0,max).lastIndexOf('$$'); lastPos = state.src.slice(0,max).lastIndexOf('$$');
lastLine = state.src.slice(pos,lastPos); lastLine = state.src.slice(pos,lastPos);
found = true; found = true;
} }
}
if(!found){
return false;
} }
state.line = next + 1; state.line = next + 1;