fix: Newlines should be interpreted as paragraphs when pasting

closes #3421
This commit is contained in:
Tom Moor
2022-06-09 20:58:52 +02:00
parent 32cdb3f961
commit 1c7c478a4a

View File

@@ -30,6 +30,9 @@ function normalizePastedMarkdown(text: string): string {
// find multiple newlines and insert a hard break to ensure they are respected
text = text.replace(/\n{2,}/g, "\n\n\\\n");
// find single newlines and insert an extra to ensure they are treated as paragraphs
text = text.replace(/\b\n\b/g, "\n\n");
return text;
}