Skip to content

Commit 266f47b

Browse files
authored
Merge pull request #23 from sharwell/render-as-markdown
Implement DOC900 RenderAsMarkdown
2 parents 3d310f0 + ade62fd commit 266f47b

21 files changed

Lines changed: 1975 additions & 20 deletions

DOCUMENTATION.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ DocumentationAnalyzers provides warnings that indicate documentation rule violat
66

77
Rules related to the style of documentation comments.
88

9+
**[Refactorings (DOC900-)](docs/Refactorings.md)**
10+
11+
Additional refactorings provided when the analyzer is installed.
12+
913
### Additional documentation

DocumentationAnalyzers/DocumentationAnalyzers.CodeFixes/DocumentationAnalyzers.CodeFixes.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
<PropertyGroup>
55
<TargetFrameworks>netstandard1.1;net452</TargetFrameworks>
6+
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
67
<RootNamespace>DocumentationAnalyzers</RootNamespace>
78
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
89
<IncludeSymbols>true</IncludeSymbols>
@@ -35,6 +36,7 @@
3536
<ItemGroup>
3637
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="1.2.1" />
3738
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="1.2.1" />
39+
<PackageReference Include="CommonMark.NET" Version="0.15.1" />
3840
</ItemGroup>
3941

4042
<ItemGroup>

DocumentationAnalyzers/DocumentationAnalyzers.CodeFixes/DocumentationAnalyzers.nuspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
<file src="bin\$Configuration$\netstandard1.1\**\DocumentationAnalyzers.CodeFixes.resources.dll" target="analyzers\dotnet\cs" />
2626
<file src="bin\$Configuration$\netstandard1.1\DocumentationAnalyzers.CodeFixes.pdb" target="analyzers\dotnet\cs" />
2727

28+
<!-- Dependencies -->
29+
<file src="bin\$Configuration$\netstandard1.1\CommonMark.dll" target="analyzers\dotnet\cs" />
30+
2831
<!-- Scripts -->
2932
<file src="tools\install.ps1" target="tools\" />
3033
<file src="tools\uninstall.ps1" target="tools\" />

DocumentationAnalyzers/DocumentationAnalyzers.CodeFixes/Helpers/XmlSyntaxFactory.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ public static SyntaxList<XmlNodeSyntax> List(params XmlNodeSyntax[] nodes)
7373
return SyntaxFactory.List(nodes);
7474
}
7575

76-
public static XmlTextSyntax Text(string value)
76+
public static XmlTextSyntax Text(string value, bool xmlEscape = true)
7777
{
78-
return Text(TextLiteral(value));
78+
return Text(TextLiteral(value, escapeQuotes: false, xmlEscape));
7979
}
8080

8181
public static XmlTextSyntax Text(params SyntaxToken[] textTokens)
@@ -162,12 +162,12 @@ public static SyntaxToken TextNewLine(string text, bool continueComment)
162162

163163
public static SyntaxToken TextLiteral(string value)
164164
{
165-
return TextLiteral(value, false);
165+
return TextLiteral(value, escapeQuotes: false);
166166
}
167167

168-
public static SyntaxToken TextLiteral(string value, bool escapeQuotes)
168+
public static SyntaxToken TextLiteral(string value, bool escapeQuotes, bool xmlEscape = true)
169169
{
170-
string encoded = new XText(value).ToString();
170+
string encoded = xmlEscape ? new XText(value).ToString() : value;
171171
if (escapeQuotes)
172172
{
173173
encoded = encoded.Replace("\"", "&quot;");

0 commit comments

Comments
 (0)