This commit is contained in:
Mckay Wrigley
2023-04-04 09:39:37 -06:00
parent 6156a2702f
commit d570c8b1ed
19 changed files with 1685 additions and 267 deletions
+9
View File
@@ -0,0 +1,9 @@
export const cleanSourceText = (text: string) => {
return text
.trim()
.replace(/(\n){4,}/g, '\n\n\n')
.replace(/\n\n/g, ' ')
.replace(/ {3,}/g, ' ')
.replace(/\t/g, '')
.replace(/\n+(\s*\n)*/g, '\n');
};