Skip to content

Commit 9600b7f

Browse files
committed
fix(plugins/table): line map for table, table cell close tokens
add line mapping to yfm_td_close and yfm_table_close tokens
1 parent 69d9ebe commit 9600b7f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/transform/plugins/table/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ const yfmTable: MarkdownItPluginCb = (md) => {
260260
state.eMarks[end.line] = oldEMark;
261261

262262
token = state.push('yfm_td_close', 'td', -1);
263+
state.tokens[state.tokens.length - 1].map = [end.line, end.line + 1];
263264
}
264265

265266
if (rowLength < maxRowLength) {
@@ -276,6 +277,7 @@ const yfmTable: MarkdownItPluginCb = (md) => {
276277
token = state.push('yfm_tbody_close', 'tbody', -1);
277278

278279
token = state.push('yfm_table_close', 'table', -1);
280+
state.tokens[state.tokens.length - 1].map = [endOfTable, endOfTable + 1];
279281

280282
state.lineMax = oldParentLineMax;
281283
state.line = endOfTable;

0 commit comments

Comments
 (0)