FIX: keep newlines between paragraphs when quoting a post
This commit is contained in:
parent
93f2c97266
commit
65ab5f58fe
|
@ -102,8 +102,10 @@ export function selectedText() {
|
||||||
$div.find("img.emoji").replaceWith(function() { return this.title; });
|
$div.find("img.emoji").replaceWith(function() { return this.title; });
|
||||||
// replace br with newlines
|
// replace br with newlines
|
||||||
$div.find("br").replaceWith(() => "\n");
|
$div.find("br").replaceWith(() => "\n");
|
||||||
|
// enforce newline at the end of paragraphs
|
||||||
|
$div.find("p").append(() => "\n");
|
||||||
|
|
||||||
return String($div.text()).trim();
|
return String($div.text()).trim().replace(/(^\s*\n)+/gm, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine the row and col of the caret in an element
|
// Determine the row and col of the caret in an element
|
||||||
|
|
Loading…
Reference in New Issue