nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.12k stars 623 forks source link

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

Closed raphi-0901 closed 2 weeks ago

raphi-0901 commented 3 months ago

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.

farnabaz commented 3 months ago

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.

github-actions[bot] commented 1 month ago

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] commented 2 weeks ago

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