render unclosed display block
This commit is contained in:
parent
2a45cb8b71
commit
152877dc41
1 changed files with 23 additions and 20 deletions
13
index.js
13
index.js
|
@ -88,23 +88,26 @@ function math_block(state, start, end, silent){
|
|||
found = true;
|
||||
}
|
||||
|
||||
for(next = start; next < end; ){
|
||||
if(found){ break; }
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if(!found){
|
||||
return false;
|
||||
}
|
||||
|
||||
state.line = next + 1;
|
||||
|
|
Reference in a new issue