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.

copy_and_paste: Fix missing empty string topic in message_link syntax.

Prakhar Pratyush53dc5198c67b
diff --git a/web/src/copy_and_paste.ts b/web/src/copy_and_paste.ts
index 95650a71ad8..5877290edd2 100644
--- a/web/src/copy_and_paste.ts
+++ b/web/src/copy_and_paste.ts
@@ -928,7 +928,7 @@ export function try_stream_topic_syntax_text(text: string): string | null {
}
let syntax_text = "#**" + stream_name;
- if (stream_topic.topic_name) {
+ if (stream_topic.topic_name !== undefined) {
syntax_text += ">" + stream_topic.topic_name;
}
diff --git a/web/tests/copy_and_paste.test.cjs b/web/tests/copy_and_paste.test.cjs
index dfa95d2f664..67aba3fcc7d 100644
--- a/web/tests/copy_and_paste.test.cjs
+++ b/web/tests/copy_and_paste.test.cjs
@@ -44,6 +44,7 @@ run_test("try_stream_topic_syntax_text", () => {
"http://zulip.zulipdev.com/#narrow/channel/4-Rome/topic/old.20FAILED.20EXPORT/near/100",
"#**Rome>old FAILED EXPORT@100**",
],
+ ["http://zulip.zulipdev.com/#narrow/channel/4-Rome/topic//near/100", "#**Rome>@100**"],
// malformed urls
["http://zulip.zulipdev.com/narrow/channel/4-Rome/topic/old.20FAILED.20EXPORT"],
["http://zulip.zulipdev.com/#not_narrow/channel/4-Rome/topic/old.20FAILED.20EXPORT"],