Skip to content

Conversation

GregHolmes
Copy link
Contributor

Description

Fixes a bug where unsupported language query parameters cause all language-specific content to be displayed simultaneously on MDX pages.

Problem

When a user visits an MDX page with a ?lang= query parameter for a language that exists globally but isn't supported on that specific page (e.g., ?lang=python on the statistics page which only supports JavaScript, Ruby, Java, etc.), the following occurred:

  1. determineActiveLanguage() would validate the language parameter against the global languageInfo object
  2. If the language existed globally, it would return that language even though the page doesn't support it
  3. The layout context would then set language: null because the language wasn't in the page's activeLanguages array
  4. The <If> component checks if (lang !== undefined && language) - when language is null, this condition becomes false
  5. With the language check skipped entirely, shouldShow remains true for all <If> blocks
  6. Result: All language-specific content renders simultaneously, creating a confusing mess

@GregHolmes GregHolmes self-assigned this Oct 10, 2025
Copy link

coderabbitai bot commented Oct 10, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch EDU-2046-fix-unsupported-language-not-defaulting

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant