@@ -9,9 +9,9 @@ namespace StyleCop.Analyzers.DocumentationRules
9
9
using System . Collections . Generic ;
10
10
using System . Collections . Immutable ;
11
11
using System . Linq ;
12
- using System . Text . RegularExpressions ;
13
12
using System . Xml . Linq ;
14
13
using Microsoft . CodeAnalysis ;
14
+ using Microsoft . CodeAnalysis . CSharp ;
15
15
using Microsoft . CodeAnalysis . CSharp . Syntax ;
16
16
using Microsoft . CodeAnalysis . Diagnostics ;
17
17
using Microsoft . CodeAnalysis . Text ;
@@ -67,8 +67,6 @@ internal class SA1629DocumentationTextMustEndWithAPeriod : ElementDocumentationB
67
67
68
68
private static readonly ImmutableDictionary < string , string > NoCodeFixProperties = ImmutableDictionary . Create < string , string > ( ) . Add ( NoCodeFixKey , string . Empty ) ;
69
69
70
- private static readonly Regex XmlEntityRegex = new Regex ( "&[a-z]+;$" ) ;
71
-
72
70
/// <summary>
73
71
/// Initializes a new instance of the <see cref="SA1629DocumentationTextMustEndWithAPeriod"/> class.
74
72
/// </summary>
@@ -134,9 +132,9 @@ private static void HandleSectionOrBlockXmlElement(SyntaxNodeAnalysisContext con
134
132
{
135
133
int spanStart = textToken . SpanStart + textWithoutTrailingWhitespace . Length ;
136
134
ImmutableDictionary < string , string > properties = null ;
137
- if ( textWithoutTrailingWhitespace . EndsWith ( "," , StringComparison . Ordinal ) ||
138
- ( textWithoutTrailingWhitespace . EndsWith ( ";" , StringComparison . Ordinal ) &&
139
- ! XmlEntityRegex . IsMatch ( textWithoutTrailingWhitespace ) ) )
135
+ if ( textWithoutTrailingWhitespace . EndsWith ( "," , StringComparison . Ordinal )
136
+ || ( textWithoutTrailingWhitespace . EndsWith ( ";" , StringComparison . Ordinal )
137
+ && ! textToken . IsKind ( SyntaxKind . XmlEntityLiteralToken ) ) )
140
138
{
141
139
spanStart -= 1 ;
142
140
SetReplaceChar ( ) ;
0 commit comments