From 0b1699b034cb5c8839882d0b84c9b9464ac7ecf9 Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Fri, 11 Sep 2020 19:40:27 +0300 Subject: [PATCH] Add missing line mapping for table rows fix https://github.com/markdown-it/markdown-it/issues/705 --- lib/rules_block/table.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/rules_block/table.js b/lib/rules_block/table.js index 16ae20f8a..05fc2f360 100644 --- a/lib/rules_block/table.js +++ b/lib/rules_block/table.js @@ -175,11 +175,13 @@ module.exports = function table(state, startLine, endLine, silent) { token = state.push('tr_open', 'tr', 1); for (i = 0; i < columnCount; i++) { token = state.push('td_open', 'td', 1); + token.map = [ nextLine, nextLine + 1 ]; if (aligns[i]) { token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ]; } token = state.push('inline', '', 0); + token.map = [ nextLine, nextLine + 1 ]; token.content = columns[i] ? columns[i].trim() : ''; token.children = [];