Skip to content

Conversation

@colinrobinsonuib
Copy link
Contributor

Shiki v2 introduces no breaking changes
https://shiki.matsu.io/blog/v2

Shiki v3 renamed getHighlighter to createHighlighter and I don't think any of the other removed deprecated APIs are used by Carta
https://shiki.matsu.io/blog/v3


In carta-md only that one function change was necessary.


I was having a module issue with plugin-code:

src/index.ts:3:40 - error TS2307: Cannot find module '@shikijs/rehype/core' or its corresponding type declarations.
  There are types at '/home/colin/Github/carta/packages/plugin-code/node_modules/@shikijs/rehype/dist/core.d.mts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

3 import rehypeShikiFromHighlighter from '@shikijs/rehype/core';

I updated the moduleResolution from node to Bundler

The node module resolution strategy (now called node10) is super old. Using node16 or nodenext is better/stricter, but bundler is the safe choice if you don't want to think about it.

One nice thing in the new Shiki is that is adds fontStyle strike through support. This part of the theme is currently broken
https://github.com/BearToCode/carta/blob/master/packages/carta-md/src/lib/internal/assets/theme-light.ts#L230
but on Shiki 3.4.0 it works!

@BearToCode
Copy link
Owner

Great, thanks for your contribution! 🚀

@BearToCode BearToCode merged commit fd2d846 into BearToCode:master May 9, 2025
1 check passed
@github-actions
Copy link

github-actions bot commented May 9, 2025

🎉 This PR is included in version carta-md-v4.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented May 9, 2025

🎉 This PR is included in version @cartamd/plugin-code-v4.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants