From 880019545795fd075be89d94794bfbd05af461b5 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Fri, 15 Dec 2023 06:04:26 +0100 Subject: [PATCH] feat: update shikiji, support twoslash (#3339) --- package.json | 4 ++-- pnpm-lock.yaml | 18 +++++++++--------- src/node/markdown/plugins/highlight.ts | 3 +++ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 9b30eb78..8e64b879 100644 --- a/package.json +++ b/package.json @@ -101,8 +101,8 @@ "mark.js": "8.11.1", "minisearch": "^6.3.0", "mrmime": "^1.0.1", - "shikiji": "^0.7.4", - "shikiji-transformers": "^0.7.4", + "shikiji": "^0.9.2", + "shikiji-transformers": "^0.9.2", "vite": "^5.0.2", "vue": "^3.3.8" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 616b81ce..6616a861 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,11 +45,11 @@ importers: specifier: ^1.0.1 version: 1.0.1 shikiji: - specifier: ^0.7.4 - version: 0.7.4 + specifier: ^0.9.2 + version: 0.9.2 shikiji-transformers: - specifier: ^0.7.4 - version: 0.7.4 + specifier: ^0.9.2 + version: 0.9.2 vite: specifier: ^5.0.2 version: 5.0.5(@types/node@20.10.0) @@ -4170,14 +4170,14 @@ packages: resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==} dev: true - /shikiji-transformers@0.7.4: - resolution: {integrity: sha512-oykilNekcW2FnRGbvZm+RNWHYroSeCVMOaMMwAbxozZgpTdcJtHoA+1+MDFw6/o2hCkX88kKbxG6FwAZoUZ6WQ==} + /shikiji-transformers@0.9.2: + resolution: {integrity: sha512-WEBeNm+oUL/4OTENjnZ5G29ErNM2cPGJHRRhqjwoTFkHnsJsACtTluTaYjPEppCl46Vo3M4TV9GwrMxz2WeCSg==} dependencies: - shikiji: 0.7.4 + shikiji: 0.9.2 dev: false - /shikiji@0.7.4: - resolution: {integrity: sha512-N5dmPvyhH/zfcsuWysUEAMwRJDMz26LUns2VEUs5y4Ozbf5jkAODU0Yswjcf/tZAwpFnk5x3y34dupFMnF2+NA==} + /shikiji@0.9.2: + resolution: {integrity: sha512-bxXd5iOVvuPj0NVFWQG3YMNLAGkWHyjTGixM7wLzqJNz3WMaeiOZbOP12gjQWKMJg+Ca4jmgATrUWu/rFb3B8A==} dependencies: hast-util-to-html: 9.0.0 dev: false diff --git a/src/node/markdown/plugins/highlight.ts b/src/node/markdown/plugins/highlight.ts index dd507e7e..53c8313f 100644 --- a/src/node/markdown/plugins/highlight.ts +++ b/src/node/markdown/plugins/highlight.ts @@ -163,6 +163,9 @@ export async function highlight( transformerCompactLineOptions(lineOptions), ...userTransformers ], + meta: { + __raw: attrs + }, ...(typeof theme === 'string' || 'name' in theme ? { theme } : {