Skip to content

Commit

Permalink
Fix end source position for fenced code and raw HTML.
Browse files Browse the repository at this point in the history
Closes #141.
  • Loading branch information
jgm committed Jan 9, 2020
1 parent 94ad030 commit 1f5a827
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 1f5a827

Please sign in to comment.