content icon indicating copy to clipboard operation
content copied to clipboard

Add Default Language Field to Nuxt Config for Shiki Code Highlighting

Open raphi-0901 opened this issue 1 year ago • 1 comments

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 avatar Jul 18 '24 10:07 raphi-0901

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.

farnabaz avatar Jul 19 '24 10:07 farnabaz

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[bot] avatar Sep 18 '24 01:09 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity.

github-actions[bot] avatar Oct 18 '24 02:10 github-actions[bot]