Initial
This commit is contained in:
10
src/app/lib/parser.ts
Normal file
10
src/app/lib/parser.ts
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user