This commit is contained in:
2024-06-02 01:25:40 +03:00
parent 51b54868bd
commit 4f525b2632
18 changed files with 252 additions and 924 deletions

10
src/app/lib/parser.ts Normal file
View File

@@ -0,0 +1,10 @@
export function parse(text: string): string[] {
const replaced_text = text
.replace('/<[kK]{1}>/gm', '\n')
.replace(/(<[^>]*>|\/\/.*)/gm, '')
.replace(/\s*\n\s*/gm, '\n');
return replaced_text
.split('\n')
.map((line) => line.trim())
.filter((line) => line.length > 0);
}