mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
copy_and_paste: Fix missing empty string topic in message_link syntax.
Earlier, pasting a message_link for a message in empty string topic in the compose area resulted in #**channel_name@100** syntax instead of the correct #**channel_name>@100** syntax. This commit fixes that bug.
This commit is contained in:
committed by
Tim Abbott
parent
e08bf15682
commit
53dc5198c6
@@ -928,7 +928,7 @@ export function try_stream_topic_syntax_text(text: string): string | null {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let syntax_text = "#**" + stream_name;
|
let syntax_text = "#**" + stream_name;
|
||||||
if (stream_topic.topic_name) {
|
if (stream_topic.topic_name !== undefined) {
|
||||||
syntax_text += ">" + stream_topic.topic_name;
|
syntax_text += ">" + stream_topic.topic_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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",
|
"http://zulip.zulipdev.com/#narrow/channel/4-Rome/topic/old.20FAILED.20EXPORT/near/100",
|
||||||
"#**Rome>old FAILED EXPORT@100**",
|
"#**Rome>old FAILED EXPORT@100**",
|
||||||
],
|
],
|
||||||
|
["http://zulip.zulipdev.com/#narrow/channel/4-Rome/topic//near/100", "#**Rome>@100**"],
|
||||||
// malformed urls
|
// malformed urls
|
||||||
["http://zulip.zulipdev.com/narrow/channel/4-Rome/topic/old.20FAILED.20EXPORT"],
|
["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"],
|
["http://zulip.zulipdev.com/#not_narrow/channel/4-Rome/topic/old.20FAILED.20EXPORT"],
|
||||||
|
|||||||
Reference in New Issue
Block a user