From ea96900707663396c35475d198471bca13191691 Mon Sep 17 00:00:00 2001 From: SeinopSys Date: Sun, 3 Oct 2021 20:08:14 +0200 Subject: [PATCH] add spaces at end of lines which only contain blockquote markers --- assets/js/markdowntoolbar.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/assets/js/markdowntoolbar.js b/assets/js/markdowntoolbar.js index 0056f807..5d3cff50 100644 --- a/assets/js/markdowntoolbar.js +++ b/assets/js/markdowntoolbar.js @@ -187,6 +187,9 @@ function wrapLines(textarea, options, eachLine = true) { ? prefix + text.trim() + suffix : text.split(/\n/g).map(line => prefix + line.trim() + suffix).join('\n'); + // Force a space at the end of lines with only blockquote markers + newText = newText.replace(/^((?:>\s+)*)>$/gm, '$1> ') + return { newText, caretOffset: emptyText ? prefix.length : newText.length }; }, eachLine); }