diff --git a/src/extensions/table.js b/src/extensions/table.js new file mode 100644 index 0000000..5fb2332 --- /dev/null +++ b/src/extensions/table.js @@ -0,0 +1,92 @@ +/*global module:true*/ +(function(){ + var table = function(converter) { + var tables = {}, style = 'text-align:left;', filter; + tables.th = function(header){ + if (header.trim() === "") { return "";} + var id = header.trim().replace(/ /g, '_').toLowerCase(); + return '
First Header | +Second Header | +
---|---|
Row 1 Cell 1 | +Row 1 Cell 2 | +
Row 2 Cell 1 | +Row 2 Cell 2 | +
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent nisi est, +ullamcorper euismod iaculis sed, tristique at neque. Nullam metus risus, +malesuada vitae imperdiet ac, tincidunt eget lacus. Proin ullamcorper +vulputate dictum. Vestibulum consequat ultricies nibh, sed tempus nisl mattis a.
+ +First Header | +Second Header | +
---|---|
Row 1 Cell 1 | +Row 1 Cell 2 | +
Row 2 Cell 1 | +Row 2 Cell 2 | +
Etiam iaculis urna vitae risus facilisis faucibus eu quis risus. Sed aliquet +rutrum dictum. Vivamus pulvinar malesuada ultricies. Pellentesque in commodo +nibh. Maecenas justo erat, sodales vel bibendum a, dignissim in orci. Duis +blandit ornare mi non facilisis. Aliquam rutrum fringilla lacus in semper. +Sed vel pretium lorem.
diff --git a/test/extensions/table/with-surroundings.md b/test/extensions/table/with-surroundings.md new file mode 100644 index 0000000..b55baa3 --- /dev/null +++ b/test/extensions/table/with-surroundings.md @@ -0,0 +1,16 @@ +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent nisi est, +ullamcorper euismod iaculis sed, tristique at neque. Nullam metus risus, +malesuada vitae imperdiet ac, tincidunt eget lacus. Proin ullamcorper +vulputate dictum. Vestibulum consequat ultricies nibh, sed tempus nisl mattis a. + +| First Header | Second Header | +| ------------- | ------------- | +| Row 1 Cell 1 | Row 1 Cell 2 | +| Row 2 Cell 1 | Row 2 Cell 2 | + +Phasellus ac porttitor quam. Integer cursus accumsan mauris nec interdum. +Etiam iaculis urna vitae risus facilisis faucibus eu quis risus. Sed aliquet +rutrum dictum. Vivamus pulvinar malesuada ultricies. Pellentesque in commodo +nibh. Maecenas justo erat, sodales vel bibendum a, dignissim in orci. Duis +blandit ornare mi non facilisis. Aliquam rutrum fringilla lacus in semper. +Sed vel pretium lorem. diff --git a/test/extensions/table/without-body.html b/test/extensions/table/without-body.html new file mode 100644 index 0000000..5b37e4a --- /dev/null +++ b/test/extensions/table/without-body.html @@ -0,0 +1,11 @@ +First Header | +Second Header | +
---|
| First Header | Second Header |
diff --git a/test/extensions/table/without-header-delimiter.md b/test/extensions/table/without-header-delimiter.md new file mode 100644 index 0000000..a86f2da --- /dev/null +++ b/test/extensions/table/without-header-delimiter.md @@ -0,0 +1 @@ +| First Header | Second Header |