Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

compose_paste: Update regex to match only list elements.

apoorvapendsef9369dc73dbb
diff --git a/web/src/compose_paste.ts b/web/src/compose_paste.ts
index a8f5fbd2ae4..5641d37786b 100644
--- a/web/src/compose_paste.ts
+++ b/web/src/compose_paste.ts
@@ -621,7 +621,7 @@ export function paste_handler_converter(
markdown_text = markdown_text.replaceAll(/^(\W* {0,3})(\d+)\\\. /gm, "$1$2. ");
// Removes newlines before the start of a list and between list elements.
- markdown_text = markdown_text.replaceAll(/\n+([*+-])/g, "\n$1");
+ markdown_text = markdown_text.replaceAll(/\n+([*+-])[ \t]+/g, "\n$1 ");
return markdown_text;
}