refactor: simplify spark table detection logic
This commit is contained in:
parent
6d0bd75cb6
commit
841fbc7bae
|
|
@ -208,16 +208,8 @@ export function scanDirectives(
|
|||
const [, headerRow, separatorRow, bodyRowsText] = mdMatch;
|
||||
const headers = splitTableRow(headerRow);
|
||||
|
||||
// Check if this is a spark-shaped table: first column is a dice formula
|
||||
// and one of the headers is a label marker
|
||||
const isSpark =
|
||||
DICE_HEADER_RE.test(headers[0]) &&
|
||||
headers.some(
|
||||
(h) =>
|
||||
h === "label" ||
|
||||
h === "md-table-label" ||
|
||||
h === "md-roll-label",
|
||||
);
|
||||
// Check if this looks like a spark table: first column is a dice formula
|
||||
const isSpark = DICE_HEADER_RE.test(headers[0]);
|
||||
|
||||
if (!isSpark) continue;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue