From 431380b900ab782e2761a6043fc77c515c0845ef Mon Sep 17 00:00:00 2001 From: kwaroran Date: Fri, 7 Jun 2024 19:36:23 +0900 Subject: [PATCH] refactor: Improve automark.ts code readability and remove unnecessary spaces --- src/ts/plugins/automark.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ts/plugins/automark.ts b/src/ts/plugins/automark.ts index 73a2c07a..6f31e0f0 100644 --- a/src/ts/plugins/automark.ts +++ b/src/ts/plugins/automark.ts @@ -89,7 +89,7 @@ export function risuFormater(dat:string){ continue } - const line = lines[i][1] + let line = lines[i][1] let isNumbered = false let endMarked = false if(excludesDat.includes(line[0]) || (line[1] === '.' && ['1','2','3','4','5','6','7','8','9'].includes(line[0]))){ @@ -107,6 +107,10 @@ export function risuFormater(dat:string){ let depth = 0 let depthChunk:string[] = [''] let depthChunkType:string[] = [''] + + //spaces for detection + line = ' ' + line + ' ' + for(let j=0;j