mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
Bugfix: Clear table output buffer between tables
*Details* Previously if you had 3 tables it would output like Table 1 Table 1 Table 2 Table 1 Table 2 Table 3 When we really want Table 1 Table 2 Table 3
This commit is contained in:
parent
2e102c72b2
commit
3b72b5aadf
|
@ -55,11 +55,12 @@
|
|||
return out;
|
||||
};
|
||||
filter = function(text) {
|
||||
var i=0, lines = text.split('\n'), tbl = [], line, hs, rows, out = [];
|
||||
var i=0, lines = text.split('\n'), line, hs, rows, out = [];
|
||||
for (i; i<lines.length;i+=1) {
|
||||
line = lines[i];
|
||||
// looks like a table heading
|
||||
if (line.trim().match(/^[|]{1}.*[|]{1}$/)) {
|
||||
var tbl = [];
|
||||
line = line.trim();
|
||||
tbl.push('<table>');
|
||||
hs = line.substring(1, line.length -1).split('|');
|
||||
|
|
Loading…
Reference in New Issue
Block a user