diff --git a/e2e/tests/plugin-shiki.test.ts b/e2e/tests/plugin-shiki.test.ts
index 4d7b89f44..29707a039 100644
--- a/e2e/tests/plugin-shiki.test.ts
+++ b/e2e/tests/plugin-shiki.test.ts
@@ -1,6 +1,5 @@
import path from 'node:path';
import { expect, test } from '@playwright/test';
-import fixture from '../fixtures/plugin-rss/fixture.json';
import {
getPort,
killProcess,
@@ -31,5 +30,15 @@ test.describe('plugin shiki test', async () => {
});
const shikiDoms = await page.$$('.shiki');
expect(shikiDoms.length).toBe(4);
+
+ const firstShikiDom = shikiDoms[0];
+ expect(
+ await firstShikiDom.$eval('pre', node => node.style.whiteSpace),
+ ).toBe('pre');
+
+ await firstShikiDom.$eval('button', btn => btn.click());
+ expect(
+ await firstShikiDom.$eval('pre', node => node.style.whiteSpace),
+ ).toBe('pre-wrap');
});
});
diff --git a/packages/theme-default/src/layout/DocLayout/docComponents/code/index.tsx b/packages/theme-default/src/layout/DocLayout/docComponents/code/index.tsx
index b9386640c..d6cff1b81 100644
--- a/packages/theme-default/src/layout/DocLayout/docComponents/code/index.tsx
+++ b/packages/theme-default/src/layout/DocLayout/docComponents/code/index.tsx
@@ -51,7 +51,17 @@ export function Code(props: CodeProps) {
);
case 'shiki':
default:
- return ;
+ return (
+
+ {props.children}
+
+ );
}
};