mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
compose: Remove extra blank line before lists.
Previously, inserting a bulleted or numbered list via the compose box added an extra blank line before and after the list. This commit removes the extra blank line inserted before the list. Fixes #32607.
This commit is contained in:
committed by
Tim Abbott
parent
c44c153b9a
commit
79be013882
@@ -658,14 +658,10 @@ export let format_text = (
|
||||
.split("\n")
|
||||
.map((line, i) => mark(line, i))
|
||||
.join("\n");
|
||||
// We always ensure a blank line before and after the list, as we want
|
||||
// We always ensure a blank line after the list, as we want
|
||||
// a clean separation between the list and the rest of the text, especially
|
||||
// when the markdown is rendered.
|
||||
|
||||
// Add blank line between text before and list if not already present.
|
||||
if (before_lines.length > 0 && before_lines.at(-1) !== "\n") {
|
||||
before_lines += "\n";
|
||||
}
|
||||
// Add blank line between list and rest of text if not already present.
|
||||
if (after_lines.length > 0 && after_lines.at(0) !== "\n") {
|
||||
after_lines = "\n" + after_lines;
|
||||
|
||||
Reference in New Issue
Block a user