Browse Source

Add missing line mapping for table rows

fix https://github.com/markdown-it/markdown-it/issues/705
pull/713/head
Alex Kocharin 4 years ago
parent
commit
0b1699b034
  1. 2
      lib/rules_block/table.js

2
lib/rules_block/table.js

@ -175,11 +175,13 @@ module.exports = function table(state, startLine, endLine, silent) {
token = state.push('tr_open', 'tr', 1); token = state.push('tr_open', 'tr', 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 = [];

Loading…
Cancel
Save