Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: shikijs/shiki
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.10.0
Choose a base ref
...
head repository: shikijs/shiki
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.10.1
Choose a head ref
  • 4 commits
  • 14 files changed
  • 1 contributor

Commits on Jun 28, 2024

  1. chore: dedupe

    antfu committed Jun 28, 2024
    Copy the full SHA
    4c1de34 View commit details

Commits on Jul 2, 2024

  1. fix(rehype): default export use shared highlighter instance, fix #714

    antfu committed Jul 2, 2024
    Copy the full SHA
    c4f030d View commit details
  2. chore: update deps

    antfu committed Jul 2, 2024
    Copy the full SHA
    c50de32 View commit details
  3. chore: release v1.10.1

    antfu committed Jul 2, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    75e17a4 View commit details
2 changes: 2 additions & 0 deletions docs/packages/rehype.md
Original file line number Diff line number Diff line change
@@ -38,6 +38,8 @@ const file = await unified()
.process(await fs.readFile('./input.md'))
```

The default export of `@shikijs/rehype` uses a shared instance of `shiki` from `getSingletonHighlighter`, which will persist across processes. If you want full control over the highlighter lifecycle, use [Fine-grained Bundle `@shikijs/rehype/core`](#fine-grained-bundle) instead.

## Fine-grained Bundle

By default, the full bundle of `shiki` will be imported. If you are using a [fine-grained bundle](/guide/install#fine-grained-bundle), you can import `rehypeShikiFromHighlighter` from `@shikijs/rehype/core` and pass your own highlighter:
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "module",
"version": "1.10.0",
"version": "1.10.1",
"private": true,
"packageManager": "pnpm@9.4.0",
"scripts": {
@@ -14,7 +14,7 @@
"prepare": "simple-git-hooks"
},
"devDependencies": {
"@antfu/eslint-config": "^2.21.1",
"@antfu/eslint-config": "^2.21.2",
"@antfu/ni": "^0.21.12",
"@antfu/utils": "^0.7.10",
"@rollup/plugin-alias": "^5.1.0",
@@ -34,7 +34,7 @@
"@vitest/coverage-v8": "^1.6.0",
"ansi-sequence-parser": "^1.1.1",
"bumpp": "^9.4.1",
"eslint": "^9.5.0",
"eslint": "^9.6.0",
"eslint-plugin-format": "^0.1.2",
"esno": "^4.7.0",
"fast-glob": "^3.3.2",
@@ -56,14 +56,14 @@
"rollup-plugin-typescript2": "^0.36.0",
"shiki": "workspace:*",
"simple-git-hooks": "^2.11.1",
"taze": "^0.13.9",
"typescript": "^5.5.2",
"taze": "^0.14.1",
"typescript": "^5.5.3",
"unbuild": "^2.0.0",
"vite": "^5.3.2",
"vite-tsconfig-paths": "^4.3.2",
"vitepress-plugin-mermaid": "^2.0.16",
"vitest": "^1.6.0",
"vue-tsc": "^2.0.22",
"vue-tsc": "^2.0.24",
"wrangler": "^3.62.0"
},
"resolutions": {
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/cli",
"type": "module",
"version": "1.10.0",
"version": "1.10.1",
"description": "Shiki in the command line",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/compat/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/compat",
"type": "module",
"version": "1.10.0",
"version": "1.10.1",
"description": "Shiki v0.x compatible API",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/core",
"type": "module",
"version": "1.10.0",
"version": "1.10.1",
"description": "Core of Shiki",
"author": "Pine Wu <octref@gmail.com>; Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/markdown-it/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/markdown-it",
"type": "module",
"version": "1.10.0",
"version": "1.10.1",
"description": "markdown-it integration for shiki",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/monaco/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/monaco",
"type": "module",
"version": "1.10.0",
"version": "1.10.1",
"description": "Use Shiki for Monaco Editor",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/rehype/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/rehype",
"type": "module",
"version": "1.10.0",
"version": "1.10.1",
"description": "rehype integration for shiki",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
5 changes: 3 additions & 2 deletions packages/rehype/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/// <reference types="mdast-util-to-hast" />

import type { LanguageInput } from 'shiki/core'
import type { BuiltinLanguage, BuiltinTheme } from 'shiki'
import { bundledLanguages, createHighlighter } from 'shiki'
import { bundledLanguages, getSingletonHighlighter } from 'shiki'
import type { Plugin } from 'unified'
import type { Root } from 'hast'
import rehypeShikiFromHighlighter from './core'
@@ -27,7 +28,7 @@ const rehypeShiki: Plugin<[RehypeShikiOptions], Root> = function (

return async (tree) => {
if (!getHandler) {
getHandler = createHighlighter({
getHandler = getSingletonHighlighter({
themes: themeNames,
langs,
})
2 changes: 1 addition & 1 deletion packages/shiki/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "shiki",
"type": "module",
"version": "1.10.0",
"version": "1.10.1",
"description": "A beautiful Syntax Highlighter.",
"author": "Pine Wu <octref@gmail.com>; Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/transformers/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/transformers",
"type": "module",
"version": "1.10.0",
"version": "1.10.1",
"description": "Collective of common transformers transformers for Shiki",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/twoslash/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/twoslash",
"type": "module",
"version": "1.10.0",
"version": "1.10.1",
"description": "Shiki transformer for twoslash",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/vitepress-twoslash/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/vitepress-twoslash",
"type": "module",
"version": "1.10.0",
"version": "1.10.1",
"description": "Enable Twoslash support in VitePress",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
Loading