Skip to content

Lowercase all mdsnippets snippet names#2534

Merged
jeremydmiller merged 1 commit intomainfrom
fix/mdsnippet-lowercase-2530
Apr 17, 2026
Merged

Lowercase all mdsnippets snippet names#2534
jeremydmiller merged 1 commit intomainfrom
fix/mdsnippet-lowercase-2530

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

Closes #2530.

Why

The latest MarkdownSnippets.Tool (28.2.0) is case-sensitive when matching <!-- snippet: NAME --> references against #region NAME declarations. Older versions (e.g. 24.5.1) were case-insensitive — but contributors installing the current release would hit build failures on any mixed-case mismatch.

Verified empirically with both versions:

  • mdsnippets 24.5.1: <!-- snippet: SAMPLE_X --> against #region sample_x → matches ✓
  • mdsnippets 28.2.0: same pair → fails with Failed: Missing snippets: SAMPLE_X

This PR forces every snippet name to lowercase so the docs build cleanly on any version.

What changed

  • All <!-- snippet: NAME --> references in *.md lowercased
  • All #region NAME declarations that follow snippet naming conventions (sample_* / snippet_* prefix) lowercased
  • Code-organization regions with multi-word names (e.g. #region Designer generated code, #region Test setup) left untouched
  • C# changes are preprocessor-directive renames only — zero behavioral impact
  • Markdown diff is large because mdsnippets regenerated the inner anchor IDs with the new lowercase names

499 files changed (mostly markdown).

Verification

$ mdsnippets   # version 28.2.0
...
MarkdownProcessor Finished. 35ms
Finished 222ms

Clean run, no missing-snippet failures. Also verified the existing 24.5.1 install still works.

🤖 Generated with Claude Code

The latest MarkdownSnippets.Tool (28.2.0) is case-SENSITIVE when matching
<!-- snippet: NAME --> references against #region NAME declarations. Older
versions (e.g. 24.5.1) were case-insensitive, but contributors installing
the current release would get build failures on any mixed-case mismatch.

This commit lowercases every snippet name across the repo:
- All <!-- snippet: NAME --> references in *.md files
- All #region NAME declarations whose name uses the snippet naming
  convention (sample_* / snippet_* prefix)

Code-organization regions with multi-word names like
"#region Designer generated code" are left untouched.

Verified by running mdsnippets 28.2.0 (the latest version) against the
entire repo with no missing-snippet failures. The existing v24.5.1
install also continues to work.

500 files changed (mostly markdown — mdsnippets regenerates the inner
anchor IDs, which now use the lowercased names). C# changes are
preprocessor-directive renames only — no behavioral impact.

Closes #2530

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Force all mdsnippet names to be lower case

1 participant