@@ -99,13 +99,14 @@ private async Task<Document> CreateChangedDocument(CodeFixContext context, Docum
99
99
}
100
100
101
101
if ( newContent . Count > 0 )
102
- newContent = newContent . Add ( XmlSyntaxFactory . NewLine ( ) ) ;
102
+ newContent = newContent . Add ( XmlSyntaxFactory . NewLine ( ) . WithTrailingTrivia ( SyntaxFactory . DocumentationCommentExterior ( "///" ) ) ) ;
103
103
104
104
newContent = newContent . Add ( XmlSyntaxFactory . Text ( line . TrimEnd ( ) , true ) ) ;
105
105
}
106
106
107
- contentsOnly = contentsOnly
108
- . WithContent ( newContent )
107
+ contentsOnly = contentsOnly . WithContent ( newContent ) ;
108
+ contentsOnly = DocumentValueFromSummaryCodeFix
109
+ . ReplaceExteriorTrivia ( contentsOnly , leadingTrivia )
109
110
. WithLeadingTrivia ( SyntaxFactory . DocumentationCommentExterior ( "///" ) )
110
111
. WithTrailingTrivia ( SyntaxFactory . EndOfLine ( Environment . NewLine ) ) ;
111
112
@@ -116,10 +117,6 @@ private async Task<Document> CreateChangedDocument(CodeFixContext context, Docum
116
117
if ( contentsOnly == null )
117
118
return context . Document ;
118
119
119
- contentsOnly = DocumentValueFromSummaryCodeFix
120
- . ReplaceExteriorTrivia ( contentsOnly , leadingTrivia )
121
- . WithLeadingTrivia ( SyntaxFactory . DocumentationCommentExterior ( "///" ) ) ;
122
-
123
120
// Remove unnecessary nested paragraph elements
124
121
contentsOnly = contentsOnly . ReplaceNodes ( contentsOnly . DescendantNodes ( ) . OfType < XmlElementSyntax > ( ) , RemoveNestedParagraphs ) ;
125
122
@@ -192,8 +189,9 @@ private SyntaxNode RenderBlockElementAsMarkdown(SyntaxNode originalNode, SyntaxN
192
189
return elementSyntax . WithContent (
193
190
XmlSyntaxFactory . List (
194
191
XmlSyntaxFactory . NewLine ( ) . WithoutTrailingTrivia ( ) ,
195
- XmlSyntaxFactory . Text ( rendered , true ) ,
196
- XmlSyntaxFactory . NewLine ( ) . WithoutTrailingTrivia ( ) ) ) ;
192
+ XmlSyntaxFactory . Text ( " " + rendered . Replace ( "\n " , "\n " ) , true ) ,
193
+ XmlSyntaxFactory . NewLine ( ) . WithoutTrailingTrivia ( ) ,
194
+ XmlSyntaxFactory . Text ( " " ) ) ) ;
197
195
}
198
196
199
197
private string RenderAsMarkdown ( string text )
0 commit comments