Skip to content

Commit c7c0e61

Browse files
committed
Also initialize additionalLabels HashSet with StringComparer.OrdinalIgnoreCase
1 parent 273aa07 commit c7c0e61

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Elastic.Markdown/IO/MarkdownFile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ public string? NavigationTitle
5050
}
5151

5252
//indexed by slug
53-
private readonly Dictionary<string, PageTocItem> _tableOfContent = new Dictionary<string, PageTocItem>(StringComparer.OrdinalIgnoreCase);
53+
private readonly Dictionary<string, PageTocItem> _tableOfContent = new(StringComparer.OrdinalIgnoreCase);
5454
public IReadOnlyDictionary<string, PageTocItem> TableOfContents => _tableOfContent;
5555

56-
private readonly HashSet<string> _additionalLabels = new();
56+
private readonly HashSet<string> _additionalLabels = new(StringComparer.OrdinalIgnoreCase);
5757
public IReadOnlySet<string> AdditionalLabels => _additionalLabels;
5858

5959
public string FilePath { get; }

src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public override bool Match(InlineProcessor processor, ref StringSlice slice)
136136
if (!string.IsNullOrEmpty(anchor))
137137
{
138138
if (markdown == null || (!markdown.TableOfContents.TryGetValue(anchor, out var heading)
139-
&& !markdown.AdditionalLabels.Contains(anchor, StringComparer.OrdinalIgnoreCase)))
139+
&& !markdown.AdditionalLabels.Contains(anchor)))
140140
processor.EmitError(line, column, length, $"`{anchor}` does not exist in {markdown?.FileName}.");
141141

142142
else if (link.FirstChild == null && heading != null)

0 commit comments

Comments
 (0)