withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
44.18k stars 2.3k forks source link

Markdown configuration for shiki doesn't accept `defaultColor: false` #11238

Open madcampos opened 1 month ago

madcampos commented 1 month ago

Astro Info

Astro                    v4.9.2
Node                     v20.14.0
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @vite-pwa/astro-integration
                         @astrojs/sitemap
                         astro-icon

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

The configuration for markdown doesn't do anything if we set defaultColor to false. According to Shiki's docs it should remove the inline styling on code blocks.

What's the expected result?

Code blocks to have no default style when the setting is set.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-shehh9?file=astro.config.mjs

Participation

ascorbic commented 4 weeks ago

The shikiConfig options don't accept every option supported by codeToHtml, because they're not passed through as-is. It could in theory support more of them. Currently this is implemented here.

madcampos commented 2 weeks ago

Got some help with this issue, will submit a pull request with a fix :)

ematipico commented 2 weeks ago

FYI this won't be considered a fix but a new feature