@@ -57,29 +57,23 @@ public bool VisitParagraphCommand(ParagraphComment comment)
57
57
{
58
58
for ( int i = 0 ; i < comment . Content . Count ; i ++ )
59
59
{
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 )
61
63
{
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 ) ;
68
67
}
69
68
}
70
- bool tag = false ;
71
69
foreach ( var item in comment . Content . Where ( c => c . Kind == DocumentationCommentKind . TextComment ) )
72
70
{
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 ) ;
83
77
}
84
78
return true ;
85
79
}
0 commit comments