From e3760926fb71f5fcec1496411a178e798bed958d Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sat, 25 Dec 2021 01:19:49 -0500 Subject: [PATCH] [+] Collapse command --- src/scripts/extended_markdown.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/scripts/extended_markdown.ts b/src/scripts/extended_markdown.ts index 88a3f14..a4a9c8e 100644 --- a/src/scripts/extended_markdown.ts +++ b/src/scripts/extended_markdown.ts @@ -83,6 +83,17 @@ export function parseExtensions(raw: string): string lines[i] = lines[i].replace(re.command, s) } + /** + * Collapse section + */ + function collapseSection() + { + const e = findSectionEnd() + const title = lines[i].substring(lines[i].indexOf(' ') + 1).replace(re.command, '') + lines[i] = `` + lines.splice(e, 0, '\n') + } + // Run all commands in markdown while (i < lines.length) {