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;
|
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;
|
||||||
|
|
Reference in a new issue