@@ -57,29 +57,23 @@ public bool VisitParagraphCommand(ParagraphComment comment)
5757 {
5858 for ( int i = 0 ; i < comment . Content . Count ; i ++ )
5959 {
60- if ( comment . Content [ i ] . Kind == DocumentationCommentKind . InlineCommandComment )
60+ if ( comment . Content [ i ] . Kind == DocumentationCommentKind . InlineCommandComment &&
61+ i + 1 < comment . Content . Count &&
62+ comment . Content [ i + 1 ] . Kind == DocumentationCommentKind . TextComment )
6163 {
62- if ( i + 1 < comment . Content . Count &&
63- comment . Content [ i + 1 ] . Kind == DocumentationCommentKind . TextComment )
64- {
65- TextComment com = ( TextComment ) comment . Content [ i + 1 ] ;
66- com . Text = Helpers . RegexCommentCommandLeftover . Replace ( com . Text , string . Empty ) ;
67- }
64+ var textComment = ( TextComment ) comment . Content [ i + 1 ] ;
65+ textComment . Text = Helpers . RegexCommentCommandLeftover . Replace (
66+ textComment . Text , string . Empty ) ;
6867 }
6968 }
70- bool tag = false ;
7169 foreach ( var item in comment . Content . Where ( c => c . Kind == DocumentationCommentKind . TextComment ) )
7270 {
73- TextComment com = ( TextComment ) item ;
74- if ( Helpers . RegexTag . IsMatch ( com . Text ) )
75- tag = true ;
76- else if ( tag )
77- com . Text = com . Text . Substring ( 1 ) ;
78-
79- if ( com . Text . StartsWith ( "<" , StringComparison . Ordinal ) )
80- com . Text = $ "{ com . Text } { ">" } ";
81- else if ( com . Text . StartsWith ( ">" , StringComparison . Ordinal ) )
82- com . Text = com . Text . Substring ( 1 ) ;
71+ var textComment = ( TextComment ) item ;
72+
73+ if ( textComment . Text . StartsWith ( "<" , StringComparison . Ordinal ) )
74+ textComment . Text = $ "{ textComment . Text } { ">" } ";
75+ else if ( textComment . Text . StartsWith ( ">" , StringComparison . Ordinal ) )
76+ textComment . Text = textComment . Text . Substring ( 1 ) ;
8377 }
8478 return true ;
8579 }
0 commit comments