From ad36129b894916b0b6f0a6c8763b85966820ba3d Mon Sep 17 00:00:00 2001 From: mokaddem Date: Thu, 20 May 2021 14:41:57 +0200 Subject: [PATCH] fix: [rules:table] Missing `map` property --- lib/rules_block/table.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/rules_block/table.js b/lib/rules_block/table.js index 7d9208f..ebf5dbe 100644 --- a/lib/rules_block/table.js +++ b/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); }