Merge branch 'vincent314-master' into develop.

Closes #127
Closes #117
Closes #93
Closes #113
Closes #74
Closes #66
This commit is contained in:
Estevão Soares dos Santos 2015-01-04 22:17:32 +00:00
commit 9e63fec598
3 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,43 @@
<h1 id="tabletest">Table Test</h1>
<h2 id="section1">section 1</h2>
<table>
<thead>
<tr>
<th id="header1" style="text-align:left;">header1 </th>
<th id="header2" style="text-align:left;">header2 </th>
<th id="header3" style="text-align:left;">header3</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;"><p>Value1 </p></td>
<td style="text-align:left;"><p>Value2 </p></td>
<td style="text-align:left;"><p>Value3 </p></td>
</tr>
</tbody>
</table>
<h2 id="section2">section 2</h2>
<table>
<thead>
<tr>
<th id="headera" style="text-align:left;">headerA </th>
<th id="headerb" style="text-align:left;">headerB </th>
<th id="headerc" style="text-align:left;">headerC</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;"><p>ValueA </p></td>
<td style="text-align:left;"><p>ValueB </p></td>
<td style="text-align:left;"><p>ValueC </p></td>
</tr>
</tbody>
</table>

View File

@ -0,0 +1,17 @@
Table Test
============
section 1
------------
|header1 |header2 |header3|
|-----------|-----------|---------|
|Value1 |Value2 |Value3 |
section 2
-----------
|headerA |headerB |headerC|
|-----------|-----------|---------|
|ValueA |ValueB |ValueC |

24
test/testTable.js Normal file
View File

@ -0,0 +1,24 @@
var Showdown = require('../src/showdown');
var fs = require('fs');
module.exports = {
setUp:function(callback) {
this.showdown = new Showdown.converter({extensions:['table']});
callback();
},
testMakeHtml:function(test) {
var html = this.showdown.makeHtml("**blah**");
console.log(html);
test.equals(html ,'<p><strong>blah</strong></p>');
test.done();
},
testMakeTable:function(test) {
var md = fs.readFileSync('test/extensions/table/multiple-tables.md','UTF-8');
var html = fs.readFileSync('test/extensions/table/multiple-tables.html','UTF-8');
var result = this.showdown.makeHtml(md);
console.log(result);
test.equals(result, html);
test.done();
}
};