From 63657a9252cc7f87fba3c44d266a0a86d92ffb55 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Thu, 4 Apr 2024 06:30:33 +0900 Subject: [PATCH] Fix blockStartMatcher function to handle nested blocks --- src/ts/parser.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ts/parser.ts b/src/ts/parser.ts index 596e2722..edc5d26f 100644 --- a/src/ts/parser.ts +++ b/src/ts/parser.ts @@ -977,7 +977,7 @@ type blockMatch = 'ignore'|'parse'|'nothing'|'parse-pure' function blockStartMatcher(p1:string,matcherArg:matcherArg):blockMatch{ if(p1.startsWith('#if') || p1.startsWith('#if_pure ')){ - const statement = p1.substring(p1.indexOf(' ') + 1) + const statement = p1.split(' ', 2) const state = statement[1] if(state === 'true' || state === '1'){ return p1.startsWith('#if_pure') ? 'parse-pure' : 'parse' @@ -1109,6 +1109,7 @@ export function risuChatParser(da:string, arg:{ } const matchResult = blockStartMatcher(dat, matcherObj) if(matchResult === 'nothing'){ + nested[0] += `{{${dat}}}` break } else{