17
17
from zulipterminal .helper import (
18
18
Message , asynch , edit_mode_captions , match_stream , match_user ,
19
19
)
20
- from zulipterminal .ui_tools .boxes import PanelSearchBox
20
+ from zulipterminal .ui_tools .boxes import MessageBox , PanelSearchBox
21
21
from zulipterminal .ui_tools .buttons import (
22
22
HomeButton , MentionedButton , MessageLinkButton , PMButton , StarredButton ,
23
23
StreamButton , TopicButton , UnreadPMButton , UserButton ,
@@ -1081,8 +1081,16 @@ def __init__(self, controller: Any, stream_id: int) -> None:
1081
1081
stream_marker = (STREAM_MARKER_PRIVATE if stream ['invite_only' ]
1082
1082
else STREAM_MARKER_PUBLIC )
1083
1083
title = '{} {}' .format (stream_marker , stream ['name' ])
1084
- desc = stream ['description' ]
1085
- stream_info_content = [('' , [desc ]), ('Stream settings' , [])]
1084
+ rendered_desc = stream ['rendered_description' ]
1085
+ self .markup_desc , * _ = MessageBox .transform_content (
1086
+ rendered_desc ,
1087
+ self .controller .model .server_url ,
1088
+ )
1089
+ desc = urwid .Text (self .markup_desc )
1090
+
1091
+ stream_info_content = (
1092
+ [('Stream settings' , [])]
1093
+ ) # type: PopUpViewTableContent
1086
1094
popup_width , column_widths = self .calculate_table_widths (
1087
1095
stream_info_content , len (title ))
1088
1096
@@ -1101,9 +1109,14 @@ def __init__(self, controller: Any, stream_id: int) -> None:
1101
1109
# Manual because calculate_table_widths does not support checkboxes.
1102
1110
# Add 4 to checkbox label to accomodate the checkbox itself.
1103
1111
popup_width = max (popup_width , len (muted_setting .label ) + 4 ,
1104
- len (pinned_setting .label ) + 4 )
1112
+ len (pinned_setting .label ) + 4 , desc . pack ()[ 0 ] )
1105
1113
self .widgets = self .make_table_with_categories (stream_info_content ,
1106
1114
column_widths )
1115
+
1116
+ # Stream description.
1117
+ self .widgets .insert (0 , desc )
1118
+ self .widgets .insert (1 , urwid .Text ('' )) # Add a newline.
1119
+
1107
1120
self .widgets .append (muted_setting )
1108
1121
self .widgets .append (pinned_setting )
1109
1122
super ().__init__ (controller , self .widgets , 'STREAM_DESC' , popup_width ,
0 commit comments