fix: Newlines should be interpreted as paragraphs when pasting
closes #3421
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user