Skip to content

Commit

Permalink
fix a stupid logic error
Browse files Browse the repository at this point in the history
  • Loading branch information
Akhil Pillai committed Dec 28, 2024
1 parent 75e30de commit 3637a19
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions scripting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (() => {
Expand All @@ -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;
Expand Down

0 comments on commit 3637a19

Please sign in to comment.