From 3468bc4ba95034987cdfa28713f66f05bc6b7bdd Mon Sep 17 00:00:00 2001 From: JuanM04 Date: Mon, 22 Nov 2021 18:08:10 +0000 Subject: [PATCH 01/11] [ci] yarn format --- packages/astro/src/vite-plugin-build-html/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/astro/src/vite-plugin-build-html/index.ts b/packages/astro/src/vite-plugin-build-html/index.ts index 211145fd1549..bdcf7b5ffcce 100644 --- a/packages/astro/src/vite-plugin-build-html/index.ts +++ b/packages/astro/src/vite-plugin-build-html/index.ts @@ -430,9 +430,9 @@ export function rollupPluginAstroBuildHTML(options: PluginOptions): VitePlugin { // Output directly to 404.html rather than 400/index.html // Supports any other status codes, too if (name.match(STATUS_CODE_RE)) { - outPath = npath.posix.join(`${name}.html`) + outPath = npath.posix.join(`${name}.html`); } else { - outPath = npath.posix.join(name, 'index.html') + outPath = npath.posix.join(name, 'index.html'); } this.emitFile({ From d6a369f4d2713c1a31b7a6dbd386bf84651a218d Mon Sep 17 00:00:00 2001 From: JuanM04 Date: Sat, 29 Jan 2022 14:45:52 -0300 Subject: [PATCH 02/11] Added shiki to markdown-remark --- packages/markdown/remark/package.json | 1 + packages/markdown/remark/src/index.ts | 10 +++++++++- packages/markdown/remark/src/remark-shiki.ts | 18 ++++++++++++++++++ packages/markdown/remark/src/types.ts | 5 ++++- yarn.lock | 8 ++++---- 5 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 packages/markdown/remark/src/remark-shiki.ts diff --git a/packages/markdown/remark/package.json b/packages/markdown/remark/package.json index 6a0a69b45461..00a023d1d886 100644 --- a/packages/markdown/remark/package.json +++ b/packages/markdown/remark/package.json @@ -38,6 +38,7 @@ "remark-parse": "^10.0.1", "remark-rehype": "^10.0.1", "remark-smartypants": "^2.0.0", + "shiki": "^0.10.0", "unified": "^10.1.1", "unist-util-map": "^3.0.0", "unist-util-visit": "^4.1.0" diff --git a/packages/markdown/remark/src/index.ts b/packages/markdown/remark/src/index.ts index e8242279a631..8496c4d55a88 100644 --- a/packages/markdown/remark/src/index.ts +++ b/packages/markdown/remark/src/index.ts @@ -9,6 +9,7 @@ import { remarkJsx, loadRemarkJsx } from './remark-jsx.js'; import rehypeJsx from './rehype-jsx.js'; import rehypeEscape from './rehype-escape.js'; import remarkPrism from './remark-prism.js'; +import remarkShiki from './remark-shiki.js'; import remarkUnwrap from './remark-unwrap.js'; import { loadPlugins } from './load-plugins.js'; @@ -37,6 +38,8 @@ export async function renderMarkdown(content: string, opts?: MarkdownRenderingOp let { remarkPlugins = [], rehypePlugins = [] } = opts ?? {}; const scopedClassName = opts?.$?.scopedClassName; const mode = opts?.mode ?? 'mdx'; + const syntaxHighlight = opts?.syntaxHighlight ?? 'prism'; + const shikiTheme = opts?.shikiTheme ?? 'github-light'; const isMDX = mode === 'mdx'; const { headers, rehypeCollectHeaders } = createCollectHeaders(); @@ -64,7 +67,12 @@ export async function renderMarkdown(content: string, opts?: MarkdownRenderingOp parser.use([scopedStyles(scopedClassName)]); } - parser.use([remarkPrism(scopedClassName)]); + if (syntaxHighlight === 'prism') { + parser.use([remarkPrism(scopedClassName)]); + } else if (syntaxHighlight === 'shiki') { + parser.use([await remarkShiki(shikiTheme)]); + } + parser.use([[markdownToHtml as any, { allowDangerousHtml: true, passThrough: ['raw', 'mdxTextExpression', 'mdxJsxTextElement', 'mdxJsxFlowElement'] }]]); loadedRehypePlugins.forEach(([plugin, opts]) => { diff --git a/packages/markdown/remark/src/remark-shiki.ts b/packages/markdown/remark/src/remark-shiki.ts new file mode 100644 index 000000000000..f8215a0ec7d3 --- /dev/null +++ b/packages/markdown/remark/src/remark-shiki.ts @@ -0,0 +1,18 @@ +import shiki from 'shiki'; +import { visit } from 'unist-util-visit'; + +const remarkShiki = async (theme: shiki.Theme) => { + const highlighter = await shiki.getHighlighter({ theme }); + + return () => (tree: any) => { + visit(tree, 'code', (node) => { + const highlighted = highlighter.codeToHtml(node.value, { lang: node.lang ?? undefined }); + + node.type = 'html'; + node.value = highlighted; + node.children = []; + }); + }; +}; + +export default remarkShiki; diff --git a/packages/markdown/remark/src/types.ts b/packages/markdown/remark/src/types.ts index 541d3ff27337..043594c9cbbb 100644 --- a/packages/markdown/remark/src/types.ts +++ b/packages/markdown/remark/src/types.ts @@ -1,10 +1,13 @@ -import * as unified from 'unified'; +import type * as unified from 'unified'; +import type * as shiki from 'shiki'; export type UnifiedPluginImport = Promise<{ default: unified.Plugin }>; export type Plugin = string | [string, any] | UnifiedPluginImport | [UnifiedPluginImport, any]; export interface AstroMarkdownOptions { mode?: 'md' | 'mdx'; + syntaxHighlight?: 'prism' | 'shiki' | false; + shikiTheme?: shiki.Theme; remarkPlugins?: Plugin[]; rehypePlugins?: Plugin[]; } diff --git a/yarn.lock b/yarn.lock index 53b001b37ffb..661b246c78fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8180,10 +8180,10 @@ shell-quote@^1.6.1: resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.3.tgz#aa40edac170445b9a431e17bb62c0b881b9c4123" integrity sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw== -shiki@^0.9.10: - version "0.9.15" - resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.9.15.tgz#2481b46155364f236651319d2c18e329ead6fa44" - integrity sha512-/Y0z9IzhJ8nD9nbceORCqu6NgT9X6I8Fk8c3SICHI5NbZRLdZYFaB233gwct9sU0vvSypyaL/qaKvzyQGJBZSw== +shiki@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.10.0.tgz#85f21ecfa95b377ff64db6c71442c22c220e9540" + integrity sha512-iczxaIYeBFHTFrQPb9DVy2SKgYxC4Wo7Iucm7C17cCh2Ge/refnvHscUOxM85u57MfLoNOtjoEFUWt9gBexblA== dependencies: jsonc-parser "^3.0.0" vscode-oniguruma "^1.6.1" From 11fdc59e8f8001e3cbe2f9e8390c261fb84e96fa Mon Sep 17 00:00:00 2001 From: JuanM04 Date: Sat, 29 Jan 2022 14:46:07 -0300 Subject: [PATCH 03/11] Upgraded astro shiki --- packages/astro/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro/package.json b/packages/astro/package.json index a8d5deb45a78..e21587541bad 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -97,7 +97,7 @@ "sass": "^1.43.4", "semver": "^7.3.5", "send": "^0.17.1", - "shiki": "^0.9.10", + "shiki": "^0.10.0", "shorthash": "^0.0.2", "slash": "^4.0.0", "sourcemap-codec": "^1.4.8", From e223e3516a073f781c1e0c648d73b788db6b692a Mon Sep 17 00:00:00 2001 From: JuanM04 Date: Sat, 29 Jan 2022 14:52:06 -0300 Subject: [PATCH 04/11] Added minimal example --- examples/with-markdown-shiki/.gitignore | 17 ++++++ examples/with-markdown-shiki/.npmrc | 2 + examples/with-markdown-shiki/.stackblitzrc | 6 ++ examples/with-markdown-shiki/README.md | 12 ++++ examples/with-markdown-shiki/astro.config.mjs | 22 +++++++ examples/with-markdown-shiki/package.json | 14 +++++ .../with-markdown-shiki/public/favicon.ico | Bin 0 -> 4286 bytes .../with-markdown-shiki/sandbox.config.json | 11 ++++ .../src/layouts/main.astro | 20 +++++++ .../with-markdown-shiki/src/pages/index.md | 14 +++++ .../with-markdown-shiki/src/styles/global.css | 54 ++++++++++++++++++ examples/with-markdown-shiki/tsconfig.json | 5 ++ 12 files changed, 177 insertions(+) create mode 100644 examples/with-markdown-shiki/.gitignore create mode 100644 examples/with-markdown-shiki/.npmrc create mode 100644 examples/with-markdown-shiki/.stackblitzrc create mode 100644 examples/with-markdown-shiki/README.md create mode 100644 examples/with-markdown-shiki/astro.config.mjs create mode 100644 examples/with-markdown-shiki/package.json create mode 100644 examples/with-markdown-shiki/public/favicon.ico create mode 100644 examples/with-markdown-shiki/sandbox.config.json create mode 100644 examples/with-markdown-shiki/src/layouts/main.astro create mode 100644 examples/with-markdown-shiki/src/pages/index.md create mode 100644 examples/with-markdown-shiki/src/styles/global.css create mode 100644 examples/with-markdown-shiki/tsconfig.json diff --git a/examples/with-markdown-shiki/.gitignore b/examples/with-markdown-shiki/.gitignore new file mode 100644 index 000000000000..c82467453074 --- /dev/null +++ b/examples/with-markdown-shiki/.gitignore @@ -0,0 +1,17 @@ +# build output +dist + +# dependencies +node_modules/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store diff --git a/examples/with-markdown-shiki/.npmrc b/examples/with-markdown-shiki/.npmrc new file mode 100644 index 000000000000..0cc653b2c3ac --- /dev/null +++ b/examples/with-markdown-shiki/.npmrc @@ -0,0 +1,2 @@ +## force pnpm to hoist +shamefully-hoist = true \ No newline at end of file diff --git a/examples/with-markdown-shiki/.stackblitzrc b/examples/with-markdown-shiki/.stackblitzrc new file mode 100644 index 000000000000..43798ecff844 --- /dev/null +++ b/examples/with-markdown-shiki/.stackblitzrc @@ -0,0 +1,6 @@ +{ + "startCommand": "npm start", + "env": { + "ENABLE_CJS_IMPORTS": true + } +} \ No newline at end of file diff --git a/examples/with-markdown-shiki/README.md b/examples/with-markdown-shiki/README.md new file mode 100644 index 000000000000..d97d1855d89e --- /dev/null +++ b/examples/with-markdown-shiki/README.md @@ -0,0 +1,12 @@ +# Astro Example: Markdown with Shiki + +``` +npm init astro -- --template with-markdown-shiki +``` + +[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/with-markdown) + +This example showcases Astro's [built-in Markdown support](../../docs/markdown.md). + +- `src/pages/index.astro` uses Astro's `` component. +- `src/pages/other.md` is a treated as a page entrypoint and uses a `layout`. diff --git a/examples/with-markdown-shiki/astro.config.mjs b/examples/with-markdown-shiki/astro.config.mjs new file mode 100644 index 000000000000..bb2a783215d7 --- /dev/null +++ b/examples/with-markdown-shiki/astro.config.mjs @@ -0,0 +1,22 @@ +// Full Astro Configuration API Documentation: +// https://docs.astro.build/reference/configuration-reference + +// @type-check enabled! +// VSCode and other TypeScript-enabled text editors will provide auto-completion, +// helpful tooltips, and warnings if your exported object is invalid. +// You can disable this by removing "@ts-check" and `@type` comments below. +import astroRemark from '@astrojs/markdown-remark'; + +// @ts-check +export default /** @type {import('astro').AstroUserConfig} */ ({ + // Enable Custom Markdown options, plugins, etc. + markdownOptions: { + render: [ + astroRemark, + { + syntaxHighlight: 'shiki', + shikiTheme: 'dracula', + }, + ], + }, +}); diff --git a/examples/with-markdown-shiki/package.json b/examples/with-markdown-shiki/package.json new file mode 100644 index 000000000000..1573fe5863ab --- /dev/null +++ b/examples/with-markdown-shiki/package.json @@ -0,0 +1,14 @@ +{ + "name": "@example/with-markdown-shiki", + "version": "0.0.1", + "private": true, + "scripts": { + "dev": "astro dev", + "start": "astro dev", + "build": "astro build", + "preview": "astro preview" + }, + "devDependencies": { + "astro": "^0.22.20" + } +} diff --git a/examples/with-markdown-shiki/public/favicon.ico b/examples/with-markdown-shiki/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..578ad458b8906c08fbed84f42b045fea04db89d1 GIT binary patch literal 4286 zcmchZF=!M)6ox0}Fc8GdTHG!cdIY>nA!3n2f|wxIl0rn}Hl#=uf>?-!2r&jMEF^_k zh**lGut*gwBmoNv7AaB&2~nbzULg{WBhPQ{ZVzvF_HL8Cb&hv$_s#qN|IO^o>?+mA zuTW6tU%k~z<&{z+7$G%*nRsTcEO|90xy<-G5&JTt%CgZZCDT4%R?+{Vd^wh>P8_)} z`+dF$HQb9!>1o`Ivn;GInlCw{9T@Rt%q+d^T3Ke%cxkk;$v`{s^zCB9nHAv6w$Vbn z8fb<+eQTNM`;rf9#obfGnV#3+OQEUv4gU;{oA@zol%keY9-e>4W>p7AHmH~&!P7f7!Uj` zwgFeQ=<3G4O;mwWO`L!=R-=y3_~-DPjH3W^3f&jjCfC$o#|oGaahSL`_=f?$&Aa+W z2h8oZ+@?NUcjGW|aWJfbM*ZzxzmCPY`b~RobNrrj=rd`=)8-j`iSW64@0_b6?;GYk zNB+-fzOxlqZ?`y{OA$WigtZXa8)#p#=DPYxH=VeC_Q5q9Cv`mvW6*zU&Gnp1;oPM6 zaK_B3j(l^FyJgYeE9RrmDyhE7W2}}nW%ic#0v@i1E!yTey$W)U>fyd+!@2hWQ!Wa==NAtKoj`f3tp4y$Al`e;?)76?AjdaRR>|?&r)~3Git> zb1)a?uiv|R0_{m#A9c;7)eZ1y6l@yQ#oE*>(Z2fG-&&smPa2QTW>m*^K65^~`coP$ z8y5Y?iS<4Gz{Zg##$1mk)u-0;X|!xu^FCr;ce~X<&UWE&pBgqfYmEJTzpK9I%vr%b z3Ksd6qlPJLI%HFfeXK_^|BXiKZC>Ocu(Kk6hD3G-8usLzVG^q00Qh gz)s7ge@$ApxGu7=(6IGIk+uG&HTev01^#CH3$(Wk5&!@I literal 0 HcmV?d00001 diff --git a/examples/with-markdown-shiki/sandbox.config.json b/examples/with-markdown-shiki/sandbox.config.json new file mode 100644 index 000000000000..9178af77d7de --- /dev/null +++ b/examples/with-markdown-shiki/sandbox.config.json @@ -0,0 +1,11 @@ +{ + "infiniteLoopProtection": true, + "hardReloadOnChange": false, + "view": "browser", + "template": "node", + "container": { + "port": 3000, + "startScript": "start", + "node": "14" + } +} diff --git a/examples/with-markdown-shiki/src/layouts/main.astro b/examples/with-markdown-shiki/src/layouts/main.astro new file mode 100644 index 000000000000..1c4441a1187d --- /dev/null +++ b/examples/with-markdown-shiki/src/layouts/main.astro @@ -0,0 +1,20 @@ +--- +const { content } = Astro.props; +--- + + + + + + + + {content.title} + + + + + + + diff --git a/examples/with-markdown-shiki/src/pages/index.md b/examples/with-markdown-shiki/src/pages/index.md new file mode 100644 index 000000000000..89e58184f42b --- /dev/null +++ b/examples/with-markdown-shiki/src/pages/index.md @@ -0,0 +1,14 @@ +--- +title: Shiki demo +layout: ../layouts/main.astro +--- + +# Shiki demo + +```js +var foo = 'bar'; + +function doSomething() { + return foo; +} +``` diff --git a/examples/with-markdown-shiki/src/styles/global.css b/examples/with-markdown-shiki/src/styles/global.css new file mode 100644 index 000000000000..e8b9d031421f --- /dev/null +++ b/examples/with-markdown-shiki/src/styles/global.css @@ -0,0 +1,54 @@ +pre, +code { + color: #d4d4d4; + font-size: 14px; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + line-height: 1.5; + direction: ltr; + white-space: pre; + text-align: left; + text-shadow: none; + word-break: normal; + word-spacing: normal; + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre::selection, +code::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + pre, + code { + text-shadow: none; + } +} + +pre { + margin: 0.5rem 0 16px; + padding: 0.8rem 1rem 0.9rem; + overflow: auto; + background: #282a36; + border-radius: 4px; +} + +:not(pre) > code { + padding: 0.1em 0.3em; + color: #db4c69; + background: #f9f2f4; + border-radius: 0.3em; + white-space: pre-wrap; +} + +body { + max-width: 900px; + margin: auto; +} diff --git a/examples/with-markdown-shiki/tsconfig.json b/examples/with-markdown-shiki/tsconfig.json new file mode 100644 index 000000000000..8e881cf9c26c --- /dev/null +++ b/examples/with-markdown-shiki/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "moduleResolution": "node" + } +} From 8afd8b971e48feeb724da258f508623cd744734f Mon Sep 17 00:00:00 2001 From: JuanM04 Date: Sat, 29 Jan 2022 14:55:06 -0300 Subject: [PATCH 05/11] Changed defaults to match --- packages/markdown/remark/src/index.ts | 2 +- packages/markdown/remark/src/remark-shiki.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/markdown/remark/src/index.ts b/packages/markdown/remark/src/index.ts index 8496c4d55a88..78d64522724e 100644 --- a/packages/markdown/remark/src/index.ts +++ b/packages/markdown/remark/src/index.ts @@ -39,7 +39,7 @@ export async function renderMarkdown(content: string, opts?: MarkdownRenderingOp const scopedClassName = opts?.$?.scopedClassName; const mode = opts?.mode ?? 'mdx'; const syntaxHighlight = opts?.syntaxHighlight ?? 'prism'; - const shikiTheme = opts?.shikiTheme ?? 'github-light'; + const shikiTheme = opts?.shikiTheme ?? 'github-dark'; const isMDX = mode === 'mdx'; const { headers, rehypeCollectHeaders } = createCollectHeaders(); diff --git a/packages/markdown/remark/src/remark-shiki.ts b/packages/markdown/remark/src/remark-shiki.ts index f8215a0ec7d3..702e8b2613d9 100644 --- a/packages/markdown/remark/src/remark-shiki.ts +++ b/packages/markdown/remark/src/remark-shiki.ts @@ -6,7 +6,7 @@ const remarkShiki = async (theme: shiki.Theme) => { return () => (tree: any) => { visit(tree, 'code', (node) => { - const highlighted = highlighter.codeToHtml(node.value, { lang: node.lang ?? undefined }); + const highlighted = highlighter.codeToHtml(node.value, { lang: node.lang ?? 'plaintext' }); node.type = 'html'; node.value = highlighted; From 60b3cca043b0259e3133c90b01b2d9e024a6d95f Mon Sep 17 00:00:00 2001 From: JuanM04 Date: Sat, 29 Jan 2022 14:56:28 -0300 Subject: [PATCH 06/11] Replace `shiki` with `astro` classes --- packages/markdown/remark/src/remark-shiki.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/markdown/remark/src/remark-shiki.ts b/packages/markdown/remark/src/remark-shiki.ts index 702e8b2613d9..5becad76d7e1 100644 --- a/packages/markdown/remark/src/remark-shiki.ts +++ b/packages/markdown/remark/src/remark-shiki.ts @@ -6,10 +6,15 @@ const remarkShiki = async (theme: shiki.Theme) => { return () => (tree: any) => { visit(tree, 'code', (node) => { - const highlighted = highlighter.codeToHtml(node.value, { lang: node.lang ?? 'plaintext' }); + let html = highlighter.codeToHtml(node.value, { lang: node.lang ?? 'plaintext' }); + + // Replace "shiki" class naming with "astro". + html = html.replace('
+      
+    
+  
+
diff --git a/packages/astro/test/fixtures/astro-markdown-shiki/src/pages/astro.astro b/packages/astro/test/fixtures/astro-markdown-shiki/src/pages/astro.astro
new file mode 100644
index 000000000000..d3a3493a65e5
--- /dev/null
+++ b/packages/astro/test/fixtures/astro-markdown-shiki/src/pages/astro.astro
@@ -0,0 +1,18 @@
+---
+import { Markdown } from 'astro/components';
+import Layout from '../layouts/content.astro';
+---
+
+
+	
+		# Hello world
+
+		```
+			plaintext
+		```
+
+		```js
+			console.log('JavaScript')
+		```
+	
+
diff --git a/packages/astro/test/fixtures/astro-markdown-shiki/src/pages/index.md b/packages/astro/test/fixtures/astro-markdown-shiki/src/pages/index.md
new file mode 100644
index 000000000000..a75170537cce
--- /dev/null
+++ b/packages/astro/test/fixtures/astro-markdown-shiki/src/pages/index.md
@@ -0,0 +1,24 @@
+---
+layout: ../layouts/content.astro
+---
+
+# Hello world
+
+```yaml
+apiVersion: v3
+kind: Pod
+metadata:
+  name: rss-site
+  labels:
+    app: web
+spec:
+  containers:
+    - name: front-end
+      image: nginx
+      ports:
+        - containerPort: 80
+    - name: rss-reader
+      image: nickchase/rss-php-nginx:v1
+      ports:
+        - containerPort: 88
+```

From 57eb46ad071aa20724340b69b4d6bff88e3ead7b Mon Sep 17 00:00:00 2001
From: JuanM04 
Date: Sat, 29 Jan 2022 16:08:33 -0300
Subject: [PATCH 11/11] Updated tests a bit

---
 packages/astro/test/astro-markdown-shiki.test.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/packages/astro/test/astro-markdown-shiki.test.js b/packages/astro/test/astro-markdown-shiki.test.js
index b4968e630518..f5e254e1b196 100644
--- a/packages/astro/test/astro-markdown-shiki.test.js
+++ b/packages/astro/test/astro-markdown-shiki.test.js
@@ -29,6 +29,9 @@ describe('Astro Markdown Shiki', () => {
 		const html = await fixture.readFile('/index.html');
 		const $ = cheerio.load(html);
 
+		// There should be no HTML from Prism
+		expect($('.token')).to.have.lengthOf(0);
+
 		expect($('pre')).to.have.lengthOf(1);
 		expect($('pre').hasClass('astro-code')).to.equal(true);
 		expect($('pre').attr().style).to.equal('background-color: #ffffff');
@@ -38,6 +41,9 @@ describe('Astro Markdown Shiki', () => {
 		const html = await fixture.readFile('/astro/index.html');
 		const $ = cheerio.load(html);
 
+		// There should be no HTML from Prism
+		expect($('.token')).to.have.lengthOf(0);
+
 		expect($('pre')).to.have.lengthOf(2);
 
 		expect($('span.line')).to.have.lengthOf(2);