From 7717ec50341ca7438b21ee071c6cba9b78d14d0d Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Fri, 12 Aug 2022 14:21:47 -0400 Subject: [PATCH] [F] Fix unused functions being deleted --- 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 c53cc7c..8c955b6 100644 --- a/src/scripts/extended_markdown.ts +++ b/src/scripts/extended_markdown.ts @@ -120,6 +120,17 @@ export function parseExtensions(raw: string): string i++; } + // If I don't call these functions somewhere, they will be deleted by vite build, and it will + // raise an error when the functions are called in eval(). So I put function calls in an + // impossible condition to prevent deletion. + if (raw == 'STOP DELETING MY UNUSED FUNCTIONS!!!') + { + hideSection() + hideLines(0) + add('') + collapseSection() + } + console.log(lines.join('\n')) return lines.join('\n') }