7 lines
148 B
JavaScript
7 lines
148 B
JavaScript
export default function normalizeText(txt) {
|
|
return txt
|
|
.replace(/\n|\r|\n\r/g, " ")
|
|
.replace(/ {2,}/g, " ")
|
|
.trim();
|
|
}
|