Browse Source

Fixed line breaks in deflist

pull/24/head
Vitaly Puzrin 10 years ago
parent
commit
c6807cf2b4
  1. 2
      lib/renderer.js
  2. 21
      test/fixtures/markdown-it/deflist.txt

2
lib/renderer.js

@ -132,7 +132,7 @@ rules.paragraph_close = function (tokens, idx /*, options, env */) {
if (!tokens[idx - 1].content) { if (!tokens[idx - 1].content) {
return ''; return '';
} }
if (tokens[idx + 1].type === 'list_item_close') { if (tokens[idx + 1].type.slice(-5) === 'close') {
return ''; return '';
} }
return '\n'; return '\n';

21
test/fixtures/markdown-it/deflist.txt

@ -58,13 +58,10 @@ Term 2
. .
<dl> <dl>
<dt>Term 1</dt> <dt>Term 1</dt>
<dd>Definition 1 <dd>Definition 1</dd>
</dd>
<dt>Term 2</dt> <dt>Term 2</dt>
<dd>Definition 2a <dd>Definition 2a</dd>
</dd> <dd>Definition 2b</dd>
<dd>Definition 2b
</dd>
</dl> </dl>
. .
@ -79,8 +76,7 @@ Term 2
. .
<dl> <dl>
<dt>Term 1</dt> <dt>Term 1</dt>
<dd>paragraph <dd>paragraph</dd>
</dd>
<dt>Term 2</dt> <dt>Term 2</dt>
<dd><pre><code>code block <dd><pre><code>code block
</code></pre> </code></pre>
@ -129,16 +125,13 @@ test
<dt>foo</dt> <dt>foo</dt>
<dd><dl> <dd><dl>
<dt>bar</dt> <dt>bar</dt>
<dd>baz <dd>baz</dd>
</dd>
</dl> </dl>
</dd> </dd>
<dd>bar <dd>bar</dd>
</dd>
</dl> </dl>
</dd> </dd>
<dd>foo <dd>foo</dd>
</dd>
</dl> </dl>
. .

Loading…
Cancel
Save