chore: remove html beautify from tests

This commit is contained in:
Estevão Soares dos Santos 2016-02-02 00:29:06 +00:00
parent 6412eadf29
commit 6e5073d977
58 changed files with 316 additions and 288 deletions

BIN
dist/showdown.js vendored

Binary file not shown.

BIN
dist/showdown.js.map vendored

Binary file not shown.

BIN
dist/showdown.min.js vendored

Binary file not shown.

Binary file not shown.

View File

@ -27,12 +27,12 @@ showdown.subParser('tables', function (text, options, globals) {
}
header = showdown.subParser('spanGamut')(header, options, globals);
return '<th' + id + style + '>' + header + '</th>';
return '<th' + id + style + '>' + header + '</th>\n';
}
function parseCells(cell, style) {
var subText = showdown.subParser('spanGamut')(cell, options, globals);
return '<td' + style + '>' + subText + '</td>';
return '<td' + style + '>' + subText + '</td>\n';
}
function buildTable(headers, cells) {
@ -45,13 +45,13 @@ showdown.subParser('tables', function (text, options, globals) {
tb += '</tr>\n</thead>\n<tbody>\n';
for (i = 0; i < cells.length; ++i) {
tb += '<tr>';
tb += '<tr>\n';
for (var ii = 0; ii < tblLgn; ++ii) {
tb += cells[i][ii];
}
tb += '</tr>';
tb += '</tr>\n';
}
tb += '</tbody></table>';
tb += '</tbody>\n</table>\n';
return tb;
}

12
test/bootstrap.js vendored
View File

@ -8,16 +8,16 @@
require('source-map-support').install();
require('chai').should();
var fs = require('fs'),
os = require('os'),
/*jshint -W106 */
var fs = require('fs');
/*
os = require('os'),
beautify = require('js-beautify').html_beautify,
beauOptions = {
eol: os.EOL,
indent_size: 2,
preserve_newlines: false
};
/*jshint +W106 */
*/
function getTestSuite(dir) {
return fs.readdirSync(dir)
@ -78,8 +78,8 @@
testCase.actual = testCase.actual.trim();
//Beautify
testCase.expected = beautify(testCase.expected, beauOptions);
testCase.actual = beautify(testCase.actual, beauOptions);
//testCase.expected = beautify(testCase.expected, beauOptions);
//testCase.actual = beautify(testCase.actual, beauOptions);
// Normalize line returns
testCase.expected = testCase.expected.replace(/(\r\n)|\n|\r/g, '\n');

View File

@ -1,9 +1,13 @@
<blockquote>
<p>a blockquote with a 4 space indented line (not code)</p>
<p>a blockquote
with a 4 space indented line (not code)</p>
</blockquote>
<p>sep</p>
<blockquote>
<p>a blockquote</p>
</blockquote>
<pre><code>with some code after
</code></pre>

View File

@ -3,6 +3,7 @@
</code></pre>
<p>foo</p>
<pre><code>&gt; this is another bq
inside code
</code></pre>

View File

@ -3,6 +3,7 @@
<ol>
<li>This is the first list item.</li>
<li>This is the second list item.</li>
</ol>

View File

@ -1,4 +1,5 @@
<ul>
<li><p>Bird</p></li>
<li><p>Magic</p></li>
</ul>

View File

@ -2,6 +2,7 @@
<ol>
<li>list item 1</li>
<li>list item 2</li>
</ol>
@ -11,5 +12,6 @@
<ul>
<li>another list item 1</li>
<li>another list item 2</li>
</ul>

View File

@ -2,6 +2,7 @@
<ol>
<li>list item 1</li>
<li>list item 2</li>
</ol>
@ -12,5 +13,6 @@
<ul>
<li>another list item 1</li>
<li>another list item 2</li>
</ul>

View File

@ -2,5 +2,6 @@
<li><p>This is a major bullet point.</p>
<p>That contains multiple paragraphs.</p></li>
<li><p>And another line</p></li>
</ol>

View File

@ -1,5 +1,6 @@
<ul>
<li>This line spans
more than one line and is lazy</li>
<li>Similar to this line</li>
</ul>

View File

@ -1,5 +1,7 @@
<ol>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
</ol>

View File

@ -1,5 +1,7 @@
<ol>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
</ol>

View File

@ -1,5 +1,7 @@
<ol>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
</ol>

View File

@ -1,15 +1,17 @@
<ul>
<li><p>foo</p>
<ul>
<li><p>bazinga</p></li>
<li><p>yeah</p></li>
</ul>
</li>
<li><p>yeah</p></li></ul></li>
<li><p>bar</p>
<ol>
<li><p>damn</p></li>
<li><p>so many paragraphs</p></li>
</ol>
</li>
<li><p>so many paragraphs</p></li></ol></li>
<li><p>baz</p></li>
</ul>

View File

@ -1,5 +1,7 @@
<ul>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
</ul>

View File

@ -1,5 +1,7 @@
<ul>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
</ul>

View File

@ -1,5 +1,7 @@
<ul>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
</ul>

View File

@ -1,2 +1,3 @@
<p><img src="./pic/pic1_50.png" alt="my image" width="100px" height="20px" /></p>
<p><img src="./pic/pic1_50.png" alt="my image2" width="100px" height="20px" /></p>

View File

@ -2,8 +2,11 @@
<ul>
<li>foo</li>
<li class="task-list-item" style="list-style-type: none;"><input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> bar</li>
<li class="task-list-item" style="list-style-type: none;"><input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> baz</li>
<li class="task-list-item" style="list-style-type: none;"><input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> bazinga</li>
</ul>

View File

@ -1,9 +1,9 @@
<h1 id="somemarkdown">some markdown</h1>
<p>blabla</p>
<div>This is **not parsed**</div>
<div markdown="1">
<p>This is <strong>parsed</strong></p>
</div>
<div>This is **not parsed**</div>
<div markdown="1"><p>This is <strong>parsed</strong></p></div>
<div>This is **not parsed**</div>

View File

@ -5,17 +5,14 @@
<th style="text-align:left;">Second Header</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">Row 1 Cell 1</td>
<td style="text-align:left;">Row 1 Cell 2</td>
</tr>
<tr>
<td style="text-align:left;">Row 2 Cell 1</td>
<td style="text-align:left;">Row 2 Cell 2</td>
</tr>
</tbody>
</table>

View File

@ -1,21 +1,18 @@
<table>
<thead>
<tr>
<th id="first_header">First Header</th>
<th id="second_header">Second Header</th>
</tr>
<tr>
<th id="first_header">First Header</th>
<th id="second_header">Second Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
</tr>
<tr>
<td>Row 2 Cell 1</td>
<td>Row 2 Cell 2</td>
</tr>
<tr>
<td>Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
</tr>
<tr>
<td>Row 2 Cell 1</td>
<td>Row 2 Cell 2</td>
</tr>
</tbody>
</table>

View File

@ -1,21 +1,18 @@
<table>
<thead>
<tr>
<th>First Header</th>
<th>Second Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
</tr>
<tr>
<td>Row 2 Cell 1</td>
<td>Row 2 Cell 2</td>
</tr>
</tbody>
<thead>
<tr>
<th>First Header</th>
<th>Second Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
</tr>
<tr>
<td>Row 2 Cell 1</td>
<td>Row 2 Cell 2</td>
</tr>
</tbody>
</table>

View File

@ -1,24 +1,21 @@
<table>
<thead>
<tr>
<th>First Header</th>
<th>Second Header</th>
<th>Third Header</th>
</tr>
<tr>
<th>First Header</th>
<th>Second Header</th>
<th>Third Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>Content Cell</td>
<td>Content Cell</td>
<td>C</td>
</tr>
<tr>
<td>Content Cell</td>
<td>Content Cell</td>
<td>C</td>
</tr>
<tr>
<td>Content Cell</td>
<td>Content Cell</td>
<td>C</td>
</tr>
<tr>
<td>Content Cell</td>
<td>Content Cell</td>
<td>C</td>
</tr>
</tbody>
</table>

View File

@ -1,48 +1,42 @@
<table>
<thead>
<tr>
<th style="text-align:left;">First Header</th>
<th style="text-align:center;">Second Header</th>
<th style="text-align:right;">Third Header</th>
<th>Fourth Header</th>
</tr>
<tr>
<th style="text-align:left;">First Header</th>
<th style="text-align:center;">Second Header</th>
<th style="text-align:right;">Third Header</th>
<th>Fourth Header</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">Row 1 Cell 1</td>
<td style="text-align:center;">Row 1 Cell 2</td>
<td style="text-align:right;">Row 1 Cell 3</td>
<td>Row 1 Cell 4</td>
</tr>
<tr>
<td style="text-align:left;">Row 2 Cell 1</td>
<td style="text-align:center;">Row 2 Cell 2</td>
<td style="text-align:right;">Row 2 Cell 3</td>
<td>Row 2 Cell 4</td>
</tr>
<tr>
<td style="text-align:left;">Row 3 Cell 1</td>
<td style="text-align:center;">Row 3 Cell 2</td>
<td style="text-align:right;">Row 3 Cell 3</td>
<td>Row 3 Cell 4</td>
</tr>
<tr>
<td style="text-align:left;">Row 4 Cell 1</td>
<td style="text-align:center;">Row 4 Cell 2</td>
<td style="text-align:right;">Row 4 Cell 3</td>
<td>Row 4 Cell 4</td>
</tr>
<tr>
<td style="text-align:left;">Row 5 Cell 1</td>
<td style="text-align:center;">Row 5 Cell 2</td>
<td style="text-align:right;">Row 5 Cell 3</td>
<td>Row 5 Cell 4</td>
</tr>
<tr>
<td style="text-align:left;">Row 1 Cell 1</td>
<td style="text-align:center;">Row 1 Cell 2</td>
<td style="text-align:right;">Row 1 Cell 3</td>
<td>Row 1 Cell 4</td>
</tr>
<tr>
<td style="text-align:left;">Row 2 Cell 1</td>
<td style="text-align:center;">Row 2 Cell 2</td>
<td style="text-align:right;">Row 2 Cell 3</td>
<td>Row 2 Cell 4</td>
</tr>
<tr>
<td style="text-align:left;">Row 3 Cell 1</td>
<td style="text-align:center;">Row 3 Cell 2</td>
<td style="text-align:right;">Row 3 Cell 3</td>
<td>Row 3 Cell 4</td>
</tr>
<tr>
<td style="text-align:left;">Row 4 Cell 1</td>
<td style="text-align:center;">Row 4 Cell 2</td>
<td style="text-align:right;">Row 4 Cell 3</td>
<td>Row 4 Cell 4</td>
</tr>
<tr>
<td style="text-align:left;">Row 5 Cell 1</td>
<td style="text-align:center;">Row 5 Cell 2</td>
<td style="text-align:right;">Row 5 Cell 3</td>
<td>Row 5 Cell 4</td>
</tr>
</tbody>
</table>

View File

@ -1,48 +1,42 @@
<table>
<thead>
<tr>
<th>First Header</th>
<th>Second Header</th>
<th>Third Header</th>
<th>Fourth Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
<td>Row 1 Cell 3</td>
<td>Row 1 Cell 4</td>
</tr>
<tr>
<td>Row 2 Cell 1</td>
<td>Row 2 Cell 2</td>
<td>Row 2 Cell 3</td>
<td>Row 2 Cell 4</td>
</tr>
<tr>
<td>Row 3 Cell 1</td>
<td>Row 3 Cell 2</td>
<td>Row 3 Cell 3</td>
<td>Row 3 Cell 4</td>
</tr>
<tr>
<td>Row 4 Cell 1</td>
<td>Row 4 Cell 2</td>
<td>Row 4 Cell 3</td>
<td>Row 4 Cell 4</td>
</tr>
<tr>
<td>Row 5 Cell 1</td>
<td>Row 5 Cell 2</td>
<td>Row 5 Cell 3</td>
<td>Row 5 Cell 4</td>
</tr>
</tbody>
<thead>
<tr>
<th>First Header</th>
<th>Second Header</th>
<th>Third Header</th>
<th>Fourth Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
<td>Row 1 Cell 3</td>
<td>Row 1 Cell 4</td>
</tr>
<tr>
<td>Row 2 Cell 1</td>
<td>Row 2 Cell 2</td>
<td>Row 2 Cell 3</td>
<td>Row 2 Cell 4</td>
</tr>
<tr>
<td>Row 3 Cell 1</td>
<td>Row 3 Cell 2</td>
<td>Row 3 Cell 3</td>
<td>Row 3 Cell 4</td>
</tr>
<tr>
<td>Row 4 Cell 1</td>
<td>Row 4 Cell 2</td>
<td>Row 4 Cell 3</td>
<td>Row 4 Cell 4</td>
</tr>
<tr>
<td>Row 5 Cell 1</td>
<td>Row 5 Cell 2</td>
<td>Row 5 Cell 3</td>
<td>Row 5 Cell 4</td>
</tr>
</tbody>
</table>

View File

@ -12,18 +12,15 @@
<td style="text-align:center;">some wordy paragraph</td>
<td style="text-align:right;">$1600</td>
</tr>
<tr>
<td style="text-align:left;">col 2 is</td>
<td style="text-align:center;">centered</td>
<td style="text-align:right;">$12</td>
</tr>
<tr>
<td style="text-align:left;">zebra stripes</td>
<td style="text-align:center;">are neat</td>
<td style="text-align:right;">$1</td>
</tr>
</tbody>
</table>

View File

@ -4,20 +4,18 @@
<table>
<thead>
<tr>
<th>header1</th>
<th>header2</th>
<th>header3</th>
</tr>
<tr>
<th>header1</th>
<th>header2</th>
<th>header3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Value1</td>
<td>Value2</td>
<td>Value3</td>
</tr>
<tr>
<td>Value1</td>
<td>Value2</td>
<td>Value3</td>
</tr>
</tbody>
</table>
@ -25,19 +23,17 @@
<table>
<thead>
<tr>
<th>headerA</th>
<th>headerB</th>
<th>headerC</th>
</tr>
<tr>
<th>headerA</th>
<th>headerB</th>
<th>headerC</th>
</tr>
</thead>
<tbody>
<tr>
<td>ValueA</td>
<td>ValueB</td>
<td>ValueC</td>
</tr>
<tr>
<td>ValueA</td>
<td>ValueB</td>
<td>ValueC</td>
</tr>
</tbody>
</table>

View File

@ -1,21 +1,18 @@
<table>
<thead>
<tr>
<th>First Header</th>
<th>Second Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
</tr>
<tr>
<td>Row 2 Cell 1</td>
<td>Row 2 Cell 2</td>
</tr>
</tbody>
<thead>
<tr>
<th>First Header</th>
<th>Second Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
</tr>
<tr>
<td>Row 2 Cell 1</td>
<td>Row 2 Cell 2</td>
</tr>
</tbody>
</table>

View File

@ -4,25 +4,22 @@ malesuada vitae imperdiet ac, tincidunt eget lacus. Proin ullamcorper
vulputate dictum. Vestibulum consequat ultricies nibh, sed tempus nisl mattis a.</p>
<table>
<thead>
<tr>
<th>First Header</th>
<th>Second Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
</tr>
<tr>
<td>Row 2 Cell 1</td>
<td>Row 2 Cell 2</td>
</tr>
</tbody>
<thead>
<tr>
<th>First Header</th>
<th>Second Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
</tr>
<tr>
<td>Row 2 Cell 1</td>
<td>Row 2 Cell 2</td>
</tr>
</tbody>
</table>
<p>Phasellus ac porttitor quam. Integer cursus accumsan mauris nec interdum.

View File

@ -1,11 +1,10 @@
<table>
<thead>
<tr>
<th>First Header</th>
<th>Second Header</th>
</tr>
</thead>
<tbody>
</tbody>
<thead>
<tr>
<th>First Header</th>
<th>Second Header</th>
</tr>
</thead>
<tbody>
</tbody>
</table>

View File

@ -41,6 +41,7 @@
<ol>
<li>foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo</li>
<li>foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo</li>
</ol>
@ -50,6 +51,7 @@
<ul>
<li>foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo</li>
<li>foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo</li>
</ul>
@ -67,7 +69,7 @@
<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 _foo_bar baz_bar_ baz_foo"/></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><a href="http://myurl.com/foo_bar_baz_bar_foo">http://myurl.com/foo_bar_baz_bar_foo</a></p>

View File

@ -1,12 +1,17 @@
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>

View File

@ -1,13 +1,12 @@
<ol>
<li>
<p>Hi, I am a thing</p>
<li><p>Hi, I am a thing</p>
<pre><code class="sh language-sh">$ git clone thing.git
dfgdfg
</code></pre></li>
<li>
<p>I am another thing!</p>
<li><p>I am another thing!</p>
<pre><code class="sh language-sh">$ git clone other-thing.git

View File

@ -1,4 +1,5 @@
<blockquote>
<p>a blockquote</p>
<h1 id="followedbyanheading">followed by an heading</h1>
</blockquote>

View File

@ -1,20 +1,28 @@
<p>Test pre in a list</p>
<ul>
<li>&amp; &lt;</li>
<li><code>&amp; &lt;</code>
<ul>
<li>&amp; &lt;</li>
<li><code>&amp; &lt;</code>
<ul>
<li>&amp; &lt;</li>
<li><code>&amp; &lt;</code>
<ul>
<li>&amp; &lt;</li>
<li><code>&amp; &lt;</code></li>
</ul>
</li>
</ul>
</li>
</ul>
<li><code>&amp; &lt;</code></li></ul>
</li></ul>
</li></ul>
</li>
</ul>

View File

@ -1,5 +1,8 @@
<h2 id="title1">Title 1</h2>
<div></div>
<h1 id="title2">Title 2</h1>
<div>
</div>

View File

@ -1,2 +1,2 @@
<p>A first sentence<br />
<p>A first sentence <br />
and a line break.</p>

View File

@ -1,2 +1,2 @@
<p>A first sentence<br />
<p>A first sentence <br />
and a line break.</p>

View File

@ -1,6 +1,5 @@
<ul>
<li>
<p>a list containing a block of code</p>
<li><p>a list containing a block of code</p>
<pre><code>10 PRINT HELLO INFINITE
20 GOTO 10

View File

@ -6,5 +6,6 @@ mi posuere lectus.</p>
<p>Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.</p></li>
<li><p>Suspendisse id sem consectetuer libero luctus adipiscing.</p></li>
</ul>

View File

@ -6,5 +6,6 @@ mi posuere lectus.</p>
<p>Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.</p></li>
<li><p>Suspendisse id sem consectetuer libero luctus adipiscing.</p></li>
</ul>

View File

@ -1,11 +1,8 @@
<ol>
<li>
<p>1</p>
<li><p>1</p>
<ul>
<li>inner par list</li>
</ul>
</li>
<li>
<p>2</p>
</li>
<li>inner par list</li></ul></li>
<li><p>2</p></li>
</ol>

View File

@ -1,5 +1,7 @@
<ol>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
</ol>

View File

@ -1,5 +1,7 @@
<ol>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
</ol>

View File

@ -1,5 +1,7 @@
<ul>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
</ul>

View File

@ -1,5 +1,7 @@
<ul>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
</ul>

View File

@ -1,5 +1,7 @@
<ul>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
</ul>

View File

@ -1,5 +1,7 @@
<ul>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
</ul>

View File

@ -1,5 +1,7 @@
<ul>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
</ul>

View File

@ -1,5 +1,7 @@
<ul>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
</ul>

View File

@ -1,4 +1,5 @@
<ul>
<li><p>list item in paragraph</p></li>
<li><p>another list item in paragraph</p></li>
</ul>

View File

@ -1,4 +1,5 @@
<ul>
<li>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph in a list.</li>
<li>and yet another long long long long long long long long long long long long long long long long long long long long long long line.</li>
</ul>

View File

@ -2,6 +2,7 @@
<li>This is a list item
with the content on
multiline and indented.</li>
<li>And this another list item
with the same principle.</li>
</ul>