From b83b0ae4c5d3cd32c04c4bb971e40340ffce3abc Mon Sep 17 00:00:00 2001 From: Gleb Smirnov <57520478+smigles@users.noreply.github.com> Date: Fri, 29 Sep 2023 22:07:31 +0300 Subject: [PATCH] Fix section content type (#64) --- src/wikitext.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wikitext.ts b/src/wikitext.ts index ad75a18..bb47a9e 100644 --- a/src/wikitext.ts +++ b/src/wikitext.ts @@ -124,7 +124,7 @@ export interface Section { level: number; header: string | null; index: number; - content?: string; + content: string; } /** @@ -476,7 +476,7 @@ export function parseSections(text: string): Section[] { level: 1, header: null, index: 0, - }, + } as Section, ]; let match; while ((match = rgx.exec(text))) { @@ -485,7 +485,7 @@ export function parseSections(text: string): Section[] { level: match[1].length, header: match[2].trim(), index: match.index, - }); + } as Section); } let n = sections.length; for (let i = 0; i < n - 1; i++) {