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

Inline code is not highlighted #2805

Open BobbieGoede opened 1 month ago

BobbieGoede commented 1 month ago

Environment

n/a (could not copy output in stackblitz)

Reproduction

https://stackblitz.com/edit/github-c2mjun?file=content%2Findex.md

Describe the bug

This can be seen in the documentation as well:

Image

The code/preview implies it should have syntax highlighting.

Additional context

Somehow I could not find an existing issue about this 😅 sorry if this is a duplicate!

Logs

No response

farnabaz commented 4 weeks ago

Highlight is disabled by default, you need to enable it in nuxt.config.ts:

  content: {
    highlight: {
      theme: 'github-light'
    }
  }

Also for inline code you need to specify the language:

`const y: string = "Hello, world!";`{lang="ts"}