refactor: Improve automark.ts code readability and remove unnecessary spaces
This commit is contained in:
@@ -165,18 +165,20 @@ export function risuFormater(dat:string){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let lineResult = ''
|
||||||
|
|
||||||
while(depthChunk.length > 0){
|
while(depthChunk.length > 0){
|
||||||
result += depthChunk.pop()
|
lineResult = depthChunk.pop() + lineResult
|
||||||
}
|
}
|
||||||
|
|
||||||
if(result.startsWith(' ')){
|
if(lineResult.startsWith(' ')){
|
||||||
result = result.substring(1)
|
lineResult = lineResult.substring(1)
|
||||||
}
|
}
|
||||||
if(result.endsWith(' ')){
|
if(lineResult.endsWith(' ')){
|
||||||
result = result.substring(0,result.length-1)
|
lineResult = lineResult.substring(0,result.length-1)
|
||||||
}
|
}
|
||||||
|
|
||||||
result += '\n'
|
result += lineResult + '\n'
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.trim()
|
return result.trim()
|
||||||
|
|||||||
Reference in New Issue
Block a user