markdown: Refactor out additional properties added to Message.

This adds a new class called MessageRenderingResult to contain the
additional properties we added to the Message object (like alert_words)
as well as the rendered content to ensure typesafe reference. No
behavioral change is made except changes in typing.

This is a preparatory change for adding django-stubs to the backend.

Related: #18777
This commit is contained in:
PIG208
2021-06-17 18:20:40 +08:00
committed by Tim Abbott
parent c5e5814242
commit 75cea329b4
13 changed files with 314 additions and 239 deletions

View File

@@ -75,7 +75,7 @@ def get_default_value_for_history_public_to_subscribers(
def render_stream_description(text: str) -> str:
return markdown_convert(text, no_previews=True)
return markdown_convert(text, no_previews=True).rendered_content
def send_stream_creation_event(stream: Stream, user_ids: List[int]) -> None: