From 3637a19762a71383e566b0620fd23cc9f66b2756 Mon Sep 17 00:00:00 2001 From: Akhil Pillai Date: Sat, 28 Dec 2024 14:47:39 -0800 Subject: [PATCH] fix a stupid logic error --- scripting/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripting/index.ts b/scripting/index.ts index b7e7013..4b6cbba 100644 --- a/scripting/index.ts +++ b/scripting/index.ts @@ -54,9 +54,7 @@ for (const file of Files) { const content = await readFile(join(SourceDirectory, file), 'utf-8'); const unfilteredRows = content.split('\n').map(v => v.trim()); const rows = unfilteredRows.filter( - v => - v.replaceAll(/[\|\s\-]/gi, '').length > 0 && - (tableRowMatcher.test(v) || h2Matcher.test(v)) + v => tableRowMatcher.test(v) || h2Matcher.test(v) ); const type = (() => { @@ -73,9 +71,9 @@ for (const file of Files) { let headers: string[] = []; for (const row of rows) { if (h2Matcher.test(row)) { - title = row.slice(3); if (subSectionStack.length > 0) sectionStack.push({ type, title, headers, entries: subSectionStack }); + title = row.slice(3); subSectionStack = []; justStartedNewSection = true; continue;