Ignore non-string markdown table rows (#1648)

This commit is contained in:
red person
2026-06-03 08:17:02 +03:00
committed by GitHub
parent 648900612e
commit 77b92020c0
2 changed files with 19 additions and 1 deletions
+2 -1
View File
@@ -10,7 +10,8 @@
// cells too, so "| a | | c |" collapsed to 2 columns and misaligned with the
// header.
export function splitTableRow(row) {
return (row || '')
const text = typeof row === 'string' ? row : '';
return text
.replace(/^\s*\|/, '')
.replace(/\|\s*$/, '')
.split('|')