diff --git a/test/extensions/table/multiple-tables.html b/test/extensions/table/multiple-tables.html new file mode 100644 index 0000000..5611db1 --- /dev/null +++ b/test/extensions/table/multiple-tables.html @@ -0,0 +1,43 @@ +

Table Test

+ +

section 1

+ + + + + + + + + + + + + + + + + + +
header1 header2 header3

Value1

Value2

Value3

+ +

section 2

+ + + + + + + + + + + + + + + + + + +
headerA headerB headerC

ValueA

ValueB

ValueC

\ No newline at end of file diff --git a/test/extensions/table/multiple-tables.md b/test/extensions/table/multiple-tables.md new file mode 100644 index 0000000..25bc09e --- /dev/null +++ b/test/extensions/table/multiple-tables.md @@ -0,0 +1,17 @@ +Table Test +============ + +section 1 +------------ + +|header1 |header2 |header3| +|-----------|-----------|---------| +|Value1 |Value2 |Value3 | + + +section 2 +----------- + +|headerA |headerB |headerC| +|-----------|-----------|---------| +|ValueA |ValueB |ValueC | diff --git a/test/testTable.js b/test/testTable.js new file mode 100644 index 0000000..712f097 --- /dev/null +++ b/test/testTable.js @@ -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 ,'

blah

'); + 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(); + } +}; \ No newline at end of file