leafac / rehype-shiki

Rehype plugin to highlight code blocks with Shiki
MIT License
31 stars 3 forks source link

Shiki Version Must Exactly Match #9

Open Wakeful-Cloud opened 1 year ago

Wakeful-Cloud commented 1 year ago

Problem

The Shiki version filter ^0.11.1 does not match any Shiki version other than 0.11.1 (See here for more info), which contradicts

Shiki is declared as a peerDependency, so @leafac/rehype-shiki doesn’t have to be updated when new versions of Shiki are released (as long as Shiki’s API remain compatible). See rsclarke/rehype-shiki#48 rsclarke/rehype-shiki#46 rsclarke/rehype-shiki#47 rsclarke/rehype-shiki#2.

Solution

Change the Shiki version filter to >=0.11.1 (I've tested this with Shiki 0.14.1)

Workaround

Add the below to your package.json:

"overrides": {
  "@leafac/rehype-shiki": {
    "shiki": ">=0.11.1"
  }
}

Note: see here for more info.