topic_link: Document get_fallback_markdown_link.

This commit is contained in:
Tim Abbott
2025-06-25 12:01:03 -07:00
parent 392ac742b4
commit b437bcd5c4
2 changed files with 10 additions and 1 deletions

View File

@@ -48,7 +48,11 @@ def get_fallback_markdown_link(
stream_id: int, stream_name: str, topic_name: str | None = None, message_id: int | None = None
) -> str:
"""
Generates the markdown link syntax for a stream/topic/message link.
Helper that should only be called by other methods in this file.
Generates the vanilla markdown link syntax for a stream/topic/message link, as
a fallback for cases where the nicer Zulip link syntax would not
render properly due to special characters in the channel or topic name.
"""
escape = escape_invalid_stream_topic_characters
link = f"#narrow/channel/{stream_id}-{encode_hash_component(stream_name.replace(' ', '-'))}"