diff --git a/lib/rules_block/blockquote.js b/lib/rules_block/blockquote.js index fcb047c0e..d1057aa2f 100644 --- a/lib/rules_block/blockquote.js +++ b/lib/rules_block/blockquote.js @@ -212,7 +212,21 @@ module.exports = function blockquote(state, startLine, endLine, silent) { break; } } - if (terminate) { break; } + + if (terminate) { + if (oldIndent !== 0) { + // state.blkIndent was non-zero, we now set it to zero, + // so we need to re-calculate all offsets to appear as + // if indent wasn't changed + oldBMarks.push(state.bMarks[nextLine]); + oldBSCount.push(state.bsCount[nextLine]); + oldTShift.push(state.tShift[nextLine]); + oldSCount.push(state.sCount[nextLine]); + state.sCount[nextLine] -= oldIndent; + } + + break; + } oldBMarks.push(state.bMarks[nextLine]); oldBSCount.push(state.bsCount[nextLine]); diff --git a/test/fixtures/markdown-it/commonmark_extras.txt b/test/fixtures/markdown-it/commonmark_extras.txt index 76f6cc7d7..aca8beb6e 100644 --- a/test/fixtures/markdown-it/commonmark_extras.txt +++ b/test/fixtures/markdown-it/commonmark_extras.txt @@ -112,6 +112,27 @@ Regression test (code block + regular paragraph) . +Blockquotes inside indented lists should terminate correctly +. + - a + > b + ``` + c + ``` + - d +. + +. + Don't output empty class here: . ```