Browse Source

fix: [rules:table] Missing `map` property

pull/783/head
mokaddem 4 years ago
parent
commit
ad36129b89
  1. 4
      lib/rules_block/table.js

4
lib/rules_block/table.js

@ -151,6 +151,7 @@ module.exports = function table(state, startLine, endLine, silent) {
for (i = 0; i < columns.length; i++) {
token = state.push('th_open', 'th', 1);
token.map = [ startLine, startLine ];
if (aligns[i]) {
token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
}
@ -158,6 +159,7 @@ module.exports = function table(state, startLine, endLine, silent) {
token = state.push('inline', '', 0);
token.content = columns[i].trim();
token.children = [];
token.map = [ startLine, startLine ];
token = state.push('th_close', 'th', -1);
}
@ -194,6 +196,7 @@ module.exports = function table(state, startLine, endLine, silent) {
for (i = 0; i < columnCount; i++) {
token = state.push('td_open', 'td', 1);
token.map = [ nextLine, nextLine ];
if (aligns[i]) {
token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
}
@ -201,6 +204,7 @@ module.exports = function table(state, startLine, endLine, silent) {
token = state.push('inline', '', 0);
token.content = columns[i] ? columns[i].trim() : '';
token.children = [];
token.map = [ nextLine, nextLine ];
token = state.push('td_close', 'td', -1);
}

Loading…
Cancel
Save