Skip to content

Commit

Permalink
Fix blockquote termination inside indented lists
Browse files Browse the repository at this point in the history
close #329
  • Loading branch information
rlidwka committed Feb 14, 2017
1 parent dc1c392 commit f0e7e56
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/rules_block/blockquote.js
Expand Up @@ -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]);
Expand Down
21 changes: 21 additions & 0 deletions test/fixtures/markdown-it/commonmark_extras.txt
Expand Up @@ -112,6 +112,27 @@ Regression test (code block + regular paragraph)
</blockquote>
.

Blockquotes inside indented lists should terminate correctly
.
- a
> b
```
c
```
- d
.
<ul>
<li>a
<blockquote>
<p>b</p>
</blockquote>
<pre><code>c
</code></pre>
</li>
<li>d</li>
</ul>
.

Don't output empty class here:
.
```&#x20;
Expand Down

0 comments on commit f0e7e56

Please sign in to comment.