@@ -39,6 +39,7 @@ private static void GetCommentSections(this Comment comment, List<Section> secti
3939 case CommentCommandKind . Brief :
4040 sections . Add ( new Section ( CommentElement . Summary ) ) ;
4141 blockCommandComment . ParagraphComment . GetCommentSections ( sections ) ;
42+ sections . Add ( new Section ( CommentElement . Remarks ) ) ;
4243 break ;
4344 case CommentCommandKind . Return :
4445 case CommentCommandKind . Returns :
@@ -87,11 +88,12 @@ private static void GetCommentSections(this Comment comment, List<Section> secti
8788 }
8889 case DocumentationCommentKind . ParagraphComment :
8990 {
90- bool summaryParagraph = false ;
91+ bool assumeSummary = false ;
92+
9193 if ( sections . Count == 0 )
9294 {
95+ assumeSummary = true ;
9396 sections . Add ( new Section ( CommentElement . Summary ) ) ;
94- summaryParagraph = true ;
9597 }
9698
9799 var lastParagraphSection = sections . Last ( ) ;
@@ -102,18 +104,22 @@ private static void GetCommentSections(this Comment comment, List<Section> secti
102104 if ( inlineContentComment . HasTrailingNewline )
103105 lastParagraphSection . NewLine ( ) ;
104106
105- lastParagraphSection = sections . Last ( ) ;
107+ var newSection = sections . Last ( ) ;
108+ if ( lastParagraphSection == newSection )
109+ continue ;
110+
111+ if ( ! string . IsNullOrEmpty ( lastParagraphSection . CurrentLine . ToString ( ) ) )
112+ lastParagraphSection . NewLine ( ) ;
113+
114+ lastParagraphSection = newSection ;
106115 }
107116
108117 if ( ! string . IsNullOrEmpty ( lastParagraphSection . CurrentLine . ToString ( ) ) )
109118 lastParagraphSection . NewLine ( ) ;
110119
111- if ( sections [ 0 ] . GetLines ( ) . Count > 0 && summaryParagraph )
112- {
113- sections [ 0 ] . GetLines ( ) . AddRange ( sections . Skip ( 1 ) . SelectMany ( s => s . GetLines ( ) ) ) ;
114- sections . RemoveRange ( 1 , sections . Count - 1 ) ;
120+ // The next paragraph should be a remarks section
121+ if ( assumeSummary )
115122 sections . Add ( new Section ( CommentElement . Remarks ) ) ;
116- }
117123
118124 break ;
119125 }
0 commit comments