fix(suparsbers/lists.js): fix odd behavior for multiple consecutive lists

This commit is contained in:
Estevão Soares dos Santos 2015-05-30 00:09:30 +01:00
parent a3b412c502
commit 11f32e04a6
9 changed files with 74 additions and 4 deletions

BIN
dist/showdown.js vendored

Binary file not shown.

BIN
dist/showdown.js.map vendored

Binary file not shown.

View File

@ -0,0 +1,19 @@
<ul>
<li>foo</li>
<li>bar
<ul><li>baz
<ul><li>bazinga</li></ul></li>
<li>nhecos</li></ul></li>
<li>bada</li>
</ul>
<p>separator</p>
<ul>
<li>foo</li>
<li>bar
<ol><li>baz
<ul><li>bazinga</li></ul></li>
<li>nhecos</li></ol></li>
<li>bada</li>
</ul>

View File

@ -0,0 +1,17 @@
- foo
- bar
- baz
- bazinga
- nhecos
- bada
separator
- foo
- bar
1. baz
+ bazinga
2. nhecos
- bada

View File

@ -0,0 +1,8 @@
<ul>
<li>foo</li>
<li>bar</li>
</ul>
<ul>
<li>baz</li>
<li>bazinga</li>
</ul>

View File

@ -0,0 +1,6 @@
- foo
- bar
- baz
- bazinga

View File

@ -0,0 +1,8 @@
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>

View File

@ -0,0 +1,5 @@
* Item 1
* Item 2
1. Item 1
2. Item 2

View File

@ -15,19 +15,26 @@
.map(map('test/cases/')),
issues = fs.readdirSync('test/issues/')
.filter(filter())
.map(map('test/issues/'));
.map(map('test/issues/')),
extra = fs.readdirSync('test/extra/')
.filter(filter())
.map(map('test/extra/'));
//Tests
describe('Converter.makeHtml() simple testcases', function () {
var converter = new showdown.Converter();
for (var i = 0; i < cases.length; ++i) {
if (cases[i].name === 'github-style-at-start') {
console.log(showdown.getOptions());
}
it(cases[i].name, assertion(cases[i], converter));
}
});
describe('Converter.makeHtml() EXTRA testcases', function () {
var converter = new showdown.Converter();
for (var i = 0; i < extra.length; ++i) {
it(extra[i].name, assertion(extra[i], converter));
}
});
describe('Converter.makeHtml() issues testcase', function () {
var converter = new showdown.Converter();
for (var i = 0; i < issues.length; ++i) {