Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Default Language Field to Nuxt Config for Shiki Code Highlighting #2715

Open
raphi-0901 opened this issue Jul 18, 2024 · 2 comments
Open
Labels
enhancement New feature or request Stale

Comments

@raphi-0901
Copy link

Is your feature request related to a problem? Please describe

If a codeblock has no language specified at all, Shiki simply does not highlight anything. An extra field in the nuxt config would be nice to set an default or fallback language if the specified language does not exist or is not present at all.

Describe the solution you'd like

Add a fallback/default language field to nuxt config.

Describe alternatives you've considered

I tried to rewrite the ProsePre.vue and set the language there but it seems that the Shiki highlighting process is done before getting passed as a prop.

@raphi-0901 raphi-0901 added the enhancement New feature or request label Jul 18, 2024
@farnabaz
Copy link
Member

Thank you for creating an issue, However having a default language seems not a standard solution.
Markdown renderers treat missing languages as text language.

However, you can use content:file:beforeParse to replace ``` with ```some-language in your own project.

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale
Projects
None yet
Development

No branches or pull requests

2 participants