fix(code-group): add TOML language preset to fix missing icon#235
Open
20syldev wants to merge 1 commit intomintlify:mainfrom
Open
fix(code-group): add TOML language preset to fix missing icon#23520syldev wants to merge 1 commit intomintlify:mainfrom
20syldev wants to merge 1 commit intomintlify:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 thatSNIPPET_PRESETShad no entry fortoml, sogetIconKey("toml")returnedundefined, causing the icon lookup to fall back to the YAML devicon.tomlpreset withdisplayName: "TOML"andshikiLanguage: "yaml"(consistent with the existingSHIKI_LANG_MAPwhich uses YAML grammar for TOML highlighting)httpSnippetoptional inSnippetPresetsince config/data formats like TOML don't have an HTTP snippet targetNote
Low Risk
Low risk: small config/type change that only affects language preset lookup and optional handling of
httpSnippetfor non-HTTP formats.Overview
Fixes missing TOML language handling in code-group/snippet preset resolution by adding a
tomlentry (withdisplayName: "TOML"and YAML-based Shiki highlighting) so icon lookup can return a TOML devicon instead of falling back.Updates the
SnippetPresettype to makehttpSnippetoptional, 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.