12
12
CHECK_MARK , LIST_TITLE_BAR_LINE , PINNED_STREAMS_DIVIDER ,
13
13
)
14
14
from zulipterminal .helper import Message , asynch , match_stream , match_user
15
- from zulipterminal .ui_tools .boxes import PanelSearchBox
15
+ from zulipterminal .ui_tools .boxes import MessageBox , PanelSearchBox
16
16
from zulipterminal .ui_tools .buttons import (
17
17
HomeButton , MentionedButton , MessageLinkButton , PMButton , StarredButton ,
18
18
StreamButton , TopicButton , UnreadPMButton , UserButton ,
@@ -1045,8 +1045,11 @@ def __init__(self, controller: Any, stream_id: int) -> None:
1045
1045
self .controller = controller
1046
1046
stream = controller .model .stream_dict [stream_id ]
1047
1047
title = '# {}' .format (stream ['name' ])
1048
- desc = stream ['description' ]
1049
- stream_info_content = [('' , [desc ]), ('Stream settings' , [])]
1048
+ rendered_desc = stream ['rendered_description' ]
1049
+
1050
+ stream_info_content = (
1051
+ [('Stream settings' , [])]
1052
+ ) # type: PopUpViewTableContent
1050
1053
popup_width , column_widths = self .calculate_table_widths (
1051
1054
stream_info_content , len (title ))
1052
1055
@@ -1062,12 +1065,23 @@ def __init__(self, controller: Any, stream_id: int) -> None:
1062
1065
urwid .connect_signal (pinned_setting , 'change' ,
1063
1066
self .toggle_pinned_status )
1064
1067
1068
+ markup_desc , * _ = MessageBox .transform_content (
1069
+ rendered_desc ,
1070
+ self .controller .model .server_url ,
1071
+ )
1072
+ desc = urwid .Text (markup_desc )
1073
+
1065
1074
# Manual because calculate_table_widths does not support checkboxes.
1066
1075
# Add 4 to checkbox label to accomodate the checkbox itself.
1067
1076
popup_width = max (popup_width , len (muted_setting .label ) + 4 ,
1068
- len (pinned_setting .label ) + 4 )
1077
+ len (pinned_setting .label ) + 4 , desc . pack ()[ 0 ] )
1069
1078
self .widgets = self .make_table_with_categories (stream_info_content ,
1070
1079
column_widths )
1080
+
1081
+ # Stream description.
1082
+ self .widgets .insert (0 , desc )
1083
+ self .widgets .insert (1 , urwid .Text ('' )) # Add a newline.
1084
+
1071
1085
self .widgets .append (muted_setting )
1072
1086
self .widgets .append (pinned_setting )
1073
1087
super ().__init__ (controller , self .widgets , 'STREAM_DESC' , popup_width ,
0 commit comments