From 8c5ae8ef8fbcef72f5eeb1972a759e5d5de1899a Mon Sep 17 00:00:00 2001 From: Pascal Deschenes Date: Thu, 1 Nov 2012 16:16:34 -0400 Subject: [PATCH] add re-entering support for table content --- src/extensions/table.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/extensions/table.js b/src/extensions/table.js index 5fb2332..f712ac2 100644 --- a/src/extensions/table.js +++ b/src/extensions/table.js @@ -1,4 +1,18 @@ /*global module:true*/ +/* + * Basic table support with re-entrant parsing, where cell content + * can also specify markdown. + * + * Tables + * ====== + * + * | Col 1 | Col 2 | + * |======== |====================================================| + * |**bold** | ![Valid XHTML] (http://w3.org/Icons/valid-xhtml10) | + * | Plain | Value | + * + */ + (function(){ var table = function(converter) { var tables = {}, style = 'text-align:left;', filter; @@ -8,7 +22,7 @@ return '' + header + ''; }; tables.td = function(cell) { - return '' + cell + ''; + return '' + converter.makeHtml(cell) + ''; }; tables.ths = function(){ var out = "", i = 0, hs = [].slice.apply(arguments); @@ -67,7 +81,6 @@ tbl.push(''); // we are done with this table and we move along out.push(tbl.join('\n')); - ++i; continue; } }