Browse Source

Merge 2e58ea4303 into ff643c5bf5

pull/343/merge
Igor Bochkariov 8 years ago
committed by GitHub
parent
commit
8c5317a2ac
  1. 3
      lib/renderer.js
  2. 7
      test/commonmark.js
  3. 3
      test/fixtures/markdown-it/commonmark_extras.txt
  4. 2
      test/misc.js

3
lib/renderer.js

@ -236,6 +236,9 @@ Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {
//
needLf = false;
} else if (nextToken.tag === 'blockquote' && nextToken.tag === token.tag) {
// in spec.txt blockquote wants \n inside
} else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {
// Opening tag + closing tag of the same type. E.g. `<li></li>`.
//

7
test/commonmark.js

@ -6,11 +6,6 @@ var load = require('markdown-it-testgen').load;
var assert = require('chai').assert;
function normalize(text) {
return text.replace(/<blockquote>\n<\/blockquote>/g, '<blockquote></blockquote>');
}
function generate(path, md) {
load(path, function (data) {
data.meta = data.meta || {};
@ -20,7 +15,7 @@ function generate(path, md) {
(data.meta.skip ? describe.skip : describe)(desc, function () {
data.fixtures.forEach(function (fixture) {
it(fixture.header ? fixture.header : 'line ' + (fixture.first.range[0] - 1), function () {
assert.strictEqual(md.render(fixture.first.text), normalize(fixture.second.text));
assert.strictEqual(md.render(fixture.first.text), fixture.second.text);
});
});
});

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

@ -351,7 +351,8 @@ test
> [foo]: bar
[foo]
.
<blockquote></blockquote>
<blockquote>
</blockquote>
<p><a href="bar">foo</a></p>
.

2
test/misc.js

@ -291,7 +291,7 @@ describe('maxNesting', function () {
var md = markdownit({ maxNesting: 2 });
assert.strictEqual(
md.render('>foo\n>>bar\n>>>baz'),
'<blockquote>\n<p>foo</p>\n<blockquote></blockquote>\n</blockquote>\n'
'<blockquote>\n<p>foo</p>\n<blockquote>\n</blockquote>\n</blockquote>\n'
);
});

Loading…
Cancel
Save