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

Code.astro component no longer set .astro-code css class #5828

Closed
1 task done
giuseppelt opened this issue Jan 11, 2023 · 0 comments · Fixed by #5829
Closed
1 task done

Code.astro component no longer set .astro-code css class #5828

giuseppelt opened this issue Jan 11, 2023 · 0 comments · Fixed by #5829

Comments

@giuseppelt
Copy link
Contributor

giuseppelt commented Jan 11, 2023

What version of astro are you using?

1.9.1

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

pnpm

What operating system are you using?

Windows

Describe the Bug

The builtin component Code.astro doesn't set .astro-code css class to the rendered pre as it did before.

Starting from shiki v0.12, a new feature reported here shikijs/shiki#376 adds the theme name as css class. Even if the author added it as optional, in the end it's forced, see shikijs/shiki#376 (comment)

This causes the bug, as the replace logic of Code.astro doens't work anymore. This bug happens when astro build.

Important
Actually because the shiki version is pinned to v0.11, this bug doens't occur. When updated to v0.12, the bug will happen. The PR I submitted, just resolves this issue. It's retro compatible with the v0.11 so it can be merged nonetheless.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-hwrkkq?file=src%2Fpages%2Findex.astro,package.json&on=stackblitz

Participation

  • I am willing to submit a pull request for this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant