Browse Source

Fix skipLastLF handling in getLines

fix #116
pull/124/head
Alex Kocharin 10 years ago
parent
commit
c5ee94aaf6
  1. 2
      lib/rules_block/state_block.js
  2. 12
      test/fixtures/markdown-it/commonmark_extras.txt

2
lib/rules_block/state_block.js

@ -142,7 +142,7 @@ StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF
// Opt: don't use push queue for single line;
if (line + 1 === end) {
first = this.bMarks[line] + Math.min(this.tShift[line], indent);
last = keepLastLF ? this.bMarks[end] : this.eMarks[end - 1];
last = this.eMarks[end - 1] + (keepLastLF ? 1 : 0);
return this.src.slice(first, last);
}

12
test/fixtures/markdown-it/commonmark_extras.txt

@ -86,6 +86,18 @@ Those are two separate blockquotes:
</blockquote>
.
Regression test (code block + regular paragraph)
.
> foo
> bar
.
<blockquote>
<pre><code>foo
</code></pre>
<p>bar</p>
</blockquote>
.
Coverage. Directive can terminate paragraph.
.

Loading…
Cancel
Save