Skip to content

fix(code-group): add TOML language preset to fix missing icon#235

Open
20syldev wants to merge 1 commit intomintlify:mainfrom
20syldev:fix/toml-language-icon
Open

fix(code-group): add TOML language preset to fix missing icon#235
20syldev wants to merge 1 commit intomintlify:mainfrom
20syldev:fix/toml-language-icon

Conversation

@20syldev
Copy link
Copy Markdown

@20syldev 20syldev commented Apr 26, 2026

Summary

Fixes mintlify/mdx#40.

<CodeGroup dropdown> with a TOML code block was showing a YAML icon instead of a TOML icon. The root cause was that SNIPPET_PRESETS had no entry for toml, so getIconKey("toml") returned undefined, causing the icon lookup to fall back to the YAML devicon.

  • Added a toml preset with displayName: "TOML" and shikiLanguage: "yaml" (consistent with the existing SHIKI_LANG_MAP which uses YAML grammar for TOML highlighting)
  • Made httpSnippet optional in SnippetPreset since config/data formats like TOML don't have an HTTP snippet target

Note

Low Risk
Low risk: small config/type change that only affects language preset lookup and optional handling of httpSnippet for non-HTTP formats.

Overview
Fixes missing TOML language handling in code-group/snippet preset resolution by adding a toml entry (with displayName: "TOML" and YAML-based Shiki highlighting) so icon lookup can return a TOML devicon instead of falling back.

Updates the SnippetPreset type to make httpSnippet optional, allowing data/config formats like TOML to exist without an HTTP snippet generation target.

Reviewed by Cursor Bugbot for commit 6f6c63c. Bugbot is set up for automated code reviews on this repo. Configure here.

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.

<CodeGroup dropdown> uses a YAML icon for TOML

1 participant