do not throw error when trying to match tag at the end of the document

This commit is contained in:
nightwing 2015-01-11 22:27:12 +04:00
commit e1a5492a7f

View file

@ -545,9 +545,12 @@ var Editor = function(renderer, session) {
return;
}
if (token.type.indexOf("tag-open") != -1)
if (token.type.indexOf("tag-open") != -1) {
token = iterator.stepForward();
if (!token)
return;
}
var tag = token.value;
var depth = 0;
var prevToken = iterator.stepBackward();