From 8f8441e529ab3bc41d0929760ad4fc19d5f3aa74 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Wed, 3 Apr 2024 19:19:15 +0900 Subject: [PATCH] make parse block to trim leading and trailing whitespace in parse function --- src/ts/parser.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ts/parser.ts b/src/ts/parser.ts index 5fc291f3..1f06904e 100644 --- a/src/ts/parser.ts +++ b/src/ts/parser.ts @@ -922,7 +922,10 @@ function blockEndMatcher(p1:string,type:blockMatch,matcherArg:matcherArg):string return '' } case 'parse':{ - return p1.trim() + const trimedLines = p1.split('\n').map((v) => { + return v.trim() + }).join('\n').trim() + return trimedLines } case 'parse-pure':{ return p1