mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 04:26:23 +08:00
10 lines
204 B
TypeScript
10 lines
204 B
TypeScript
const fixNewLines = /\r?\n|\r/g;
|
|
|
|
export function normalizeText(text: string) {
|
|
return text
|
|
.replace(fixNewLines, '\n')
|
|
.split('\n')
|
|
.map(x => x || ' ')
|
|
.join('\n');
|
|
}
|