Skip to content

Fix mixed-case custom extension matching#4290

Open
puneetdixit200 wants to merge 1 commit into
11ty:mainfrom
puneetdixit200:fix-custom-extension-case-insensitive
Open

Fix mixed-case custom extension matching#4290
puneetdixit200 wants to merge 1 commit into
11ty:mainfrom
puneetdixit200:fix-custom-extension-case-insensitive

Conversation

@puneetdixit200

Copy link
Copy Markdown

Summary

  • normalize custom addExtension() extension names and keys before storing them
  • make extension-map path checks compare extensions case-insensitively
  • add regression coverage for a mixed-case vZome custom extension and duplicate mixed-case registrations

Fixes #4224.

Tests

  • npx ava --verbose test/EleventyExtensionMapTest.js
  • npx ava --verbose test/EleventyTest.js --match='*issue #4224*'
  • npx prettier --check src/UserConfig.js src/EleventyExtensionMap.js test/EleventyExtensionMapTest.js test/EleventyTest.js
  • npx eslint src/UserConfig.js src/EleventyExtensionMap.js test/EleventyExtensionMapTest.js test/EleventyTest.js (passes with the existing src/UserConfig.js unused-argument warning)
  • npm run check (passes with existing warnings)
  • npm run test:server (1417 passed, 20 skipped)
  • npm run test:client fails locally because Playwright browser executables are missing from ~/Library/Caches/ms-playwright; Vitest reports to run npx playwright install. The commit/push hooks hit the same local browser-cache blocker after the server suite passed.

@puneetdixit200 puneetdixit200 requested a review from zachleat as a code owner June 4, 2026 03:43
// on paths found from the file system glob search.
// TODO: Method name might just need to be renamed to something more accurate.
isFullTemplateFilePath(path) {
path = (path || "").toLowerCase();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally speaking: it's an anti-pattern to modify function arguments.
Can you use a new variable like the normalizedPath below?

@@ -0,0 +1 @@
mixed-case custom extension

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this file?

Comment thread test/EleventyTest.js
}`);
});

test("Mixed-case custom template extensions are discovered, issue #4224", async (t) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay, so the content is less of importance. Gotcha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

eleventyConfig.addExtension is too case-sensitive

2 participants