diff --git a/lib/blocks.js b/lib/blocks.js index 4c948d08..75a6aee6 100644 --- a/lib/blocks.js +++ b/lib/blocks.js @@ -325,6 +325,7 @@ var blocks = { ln.slice(parser.nextNonspace).match(reClosingCodeFence)); if (match && match[0].length >= container._fenceLength) { // closing fence - we're at end of line, so we can return + parser.lastLineLength = match[0].length; parser.finalize(container, parser.lineNumber); return 2; } else { @@ -673,7 +674,6 @@ var incorporateLine = function(ln) { all_matched = false; break; case 2: // we've hit end of line for fenced code close and can return - this.lastLineLength = ln.length; return; default: throw 'continue returned illegal value, must be 0, 1, or 2'; @@ -769,6 +769,7 @@ var incorporateLine = function(ln) { container._htmlBlockType >= 1 && container._htmlBlockType <= 5 && reHtmlBlockClose[container._htmlBlockType].test(this.currentLine.slice(this.offset))) { + this.lastLineLength = ln.length; this.finalize(container, this.lineNumber); }