Skip to content

Commit 8072c6b

Browse files
committed
Fix end source position for nested or indented fenrced code blocks.
Improves on earlier fix to #141, which only worked for code blocks flush with the left margin.
1 parent 2feaec3 commit 8072c6b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/blocks.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,8 @@ var blocks = {
325325
ln.slice(parser.nextNonspace).match(reClosingCodeFence));
326326
if (match && match[0].length >= container._fenceLength) {
327327
// closing fence - we're at end of line, so we can return
328-
parser.lastLineLength = match[0].length;
328+
parser.lastLineLength = parser.offset + indent +
329+
match[0].length;
329330
parser.finalize(container, parser.lineNumber);
330331
return 2;
331332
} else {

0 commit comments

Comments
 (0)