|
@ -140,14 +140,12 @@ module.exports = function table(state, startLine, endLine, silent) { |
|
|
|
|
|
|
|
|
for (i = 0; i < columns.length; i++) { |
|
|
for (i = 0; i < columns.length; i++) { |
|
|
token = state.push('th_open', 'th', 1); |
|
|
token = state.push('th_open', 'th', 1); |
|
|
token.map = [ startLine, startLine + 1 ]; |
|
|
|
|
|
if (aligns[i]) { |
|
|
if (aligns[i]) { |
|
|
token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ]; |
|
|
token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
token = state.push('inline', '', 0); |
|
|
token = state.push('inline', '', 0); |
|
|
token.content = columns[i].trim(); |
|
|
token.content = columns[i].trim(); |
|
|
token.map = [ startLine, startLine + 1 ]; |
|
|
|
|
|
token.children = []; |
|
|
token.children = []; |
|
|
|
|
|
|
|
|
token = state.push('th_close', 'th', -1); |
|
|
token = state.push('th_close', 'th', -1); |
|
@ -180,16 +178,16 @@ module.exports = function table(state, startLine, endLine, silent) { |
|
|
token.map = tbodyLines = [ startLine + 2, 0 ]; |
|
|
token.map = tbodyLines = [ startLine + 2, 0 ]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
token = state.push('tr_open', 'tr', 1); |
|
|
token = state.push('tr_open', 'tr', 1); |
|
|
|
|
|
token.map = [ nextLine, nextLine + 1 ]; |
|
|
|
|
|
|
|
|
for (i = 0; i < columnCount; i++) { |
|
|
for (i = 0; i < columnCount; i++) { |
|
|
token = state.push('td_open', 'td', 1); |
|
|
token = state.push('td_open', 'td', 1); |
|
|
token.map = [ nextLine, nextLine + 1 ]; |
|
|
|
|
|
if (aligns[i]) { |
|
|
if (aligns[i]) { |
|
|
token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ]; |
|
|
token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
token = state.push('inline', '', 0); |
|
|
token = state.push('inline', '', 0); |
|
|
token.map = [ nextLine, nextLine + 1 ]; |
|
|
|
|
|
token.content = columns[i] ? columns[i].trim() : ''; |
|
|
token.content = columns[i] ? columns[i].trim() : ''; |
|
|
token.children = []; |
|
|
token.children = []; |
|
|
|
|
|
|
|
|