mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
test: add ghost issues tests
This commit is contained in:
parent
5d0ec964e4
commit
534c53616a
4
test/bootstrap.js
vendored
4
test/bootstrap.js
vendored
|
@ -82,8 +82,8 @@
|
|||
testCase.actual = beautify(testCase.actual, beauOptions);
|
||||
|
||||
// Normalize line returns
|
||||
testCase.expected = testCase.expected.replace(/(\r\n)|\n|\r/g, os.EOL);
|
||||
testCase.actual = testCase.actual.replace(/(\r\n)|\n|\r/g, os.EOL);
|
||||
testCase.expected = testCase.expected.replace(/(\r\n)|\n|\r/g, '\n');
|
||||
testCase.actual = testCase.actual.replace(/(\r\n)|\n|\r/g, '\n');
|
||||
|
||||
return testCase;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<pre><code>foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
|
||||
</code></pre>
|
||||
|
||||
<pre><code class="language-html">foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
|
||||
<pre><code class="html language-html">foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
|
||||
</code></pre>
|
||||
|
||||
<pre>foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo</pre>
|
||||
|
@ -37,7 +37,7 @@
|
|||
|
||||
<h2 id="foo_bar_bazfoo_bar_baz_bar_foo_foo_barbaz_bar_baz_foo">foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo</h2>
|
||||
|
||||
<h3 id="foo_bar_bazfoo_bar_baz_bar_foo_foo_barbaz_bar_baz_foo">foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo</h3>
|
||||
<h3 id="foo_bar_bazfoo_bar_baz_bar_foo_foo_barbaz_bar_baz_foo-1">foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo</h3>
|
||||
|
||||
<ol>
|
||||
<li>foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo</li>
|
||||
|
@ -55,7 +55,7 @@
|
|||
|
||||
<hr />
|
||||
|
||||
<p>http://en.wikipedia.org/wiki/Tourism_in_Germany</p>
|
||||
<p><a href="http://en.wikipedia.org/wiki/Tourism_in_Germany">http://en.wikipedia.org/wiki/Tourism_in_Germany</a></p>
|
||||
|
||||
<p><a href="http://en.wikipedia.org/wiki/Tourism_in_Germany">an example</a></p>
|
||||
|
||||
|
@ -65,11 +65,11 @@
|
|||
|
||||
<!-- These two cases still have bad <ems> because showdown handles them incorrectly -->
|
||||
|
||||
<p><code>foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo</code></p>
|
||||
<p><code>foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo</code></p>
|
||||
|
||||
<p><img src="http://myurl.com/foo_bar_baz_bar_foo" alt="foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo" title="" /></p>
|
||||
<p><img src="http://myurl.com/foo_bar_baz_bar_foo" alt="foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo"/></p>
|
||||
|
||||
<p>http://myurl.com/foo_bar_baz_bar_foo</p>
|
||||
<p><a href="http://myurl.com/foo_bar_baz_bar_foo">http://myurl.com/foo_bar_baz_bar_foo</a></p>
|
||||
|
||||
<p><a href="http://myurl.com/foo_bar_baz_bar_foo">http://myurl.com/foo_bar_baz_bar_foo</a></p>
|
||||
|
|
@ -25,6 +25,8 @@ describe('makeHtml() features testsuite', function () {
|
|||
converter = new showdown.Converter({ghCodeBlocks: false});
|
||||
} else if (testsuite[i].name === '#164.4.tasklists') {
|
||||
converter = new showdown.Converter({tasklists: true});
|
||||
} else if (testsuite[i].name === 'autolink_and_disallow_underscores') {
|
||||
converter = new showdown.Converter({literalMidWordUnderscores: true, simplifiedAutoLink: true});
|
||||
} else {
|
||||
converter = new showdown.Converter();
|
||||
}
|
||||
|
|
22
test/node/testsuite.ghost.js
Normal file
22
test/node/testsuite.ghost.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* Created by Estevao on 14-07-2015.
|
||||
*/
|
||||
var bootstrap = require('../bootstrap.js'),
|
||||
converter = new bootstrap.showdown.Converter({
|
||||
strikethrough: true,
|
||||
literalMidWordUnderscores: true,
|
||||
simplifiedAutoLink: true,
|
||||
tables: true,
|
||||
parseImgDimensions: true, //extra
|
||||
tasklists: true //extra
|
||||
}),
|
||||
assertion = bootstrap.assertion,
|
||||
testsuite = bootstrap.getTestSuite('test/ghost/');
|
||||
|
||||
//MD-Testsuite (borrowed from karlcow/markdown-testsuite)
|
||||
describe('makeHtml() ghost testsuite', function () {
|
||||
'use strict';
|
||||
for (var i = 0; i < testsuite.length; ++i) {
|
||||
it(testsuite[i].name, assertion(testsuite[i], converter));
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user