Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update TocBuilder.cs
  • Loading branch information
SimonCropp committed Jan 13, 2026
commit 884c167252a399f33fc76f8568cb3499dc9e707a
3 changes: 2 additions & 1 deletion src/MarkdownSnippets/Processing/TocBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ static class TocBuilder
{
public static string BuildToc(List<Line> headerLines, int level, List<string> tocExcludes, string newLine)
{
var excludesSet = new HashSet<string>(tocExcludes, StringComparer.OrdinalIgnoreCase);
var processed = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
var builder = new StringBuilder();
builder.Append("<!-- toc -->");
Expand Down Expand Up @@ -33,7 +34,7 @@ public static string BuildToc(List<Line> headerLines, int level, List<string> to
}

var title = GetTitle(trimmedHash);
if (tocExcludes.Any(_ => string.Equals(_, title, StringComparison.OrdinalIgnoreCase)))
if (excludesSet.Contains(title))
{
continue;
}
Expand Down