Skip to content

Commit f61ccae

Browse files
authored
MarkdownContentBox: always fallback to shell highlight (#2657)
1 parent 423884c commit f61ccae

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

components/Package/MarkdownContentBox/MarkdownRenderer.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,12 @@ export default function MarkdownRenderer({ data, repoUrl, linkableHeaders = true
153153
),
154154
pre: ({ children }: any) => {
155155
const langClass = children?.props?.className;
156-
if (langClass) {
157-
return (
158-
<MarkdownCodeBlock
159-
code={children.props.children}
160-
theme={(tw.prefixMatch('dark') ? rndDark : rndLight) as Theme}
161-
lang={langClass ? (langClass.split('-')[1] ?? 'sh').toLowerCase() : 'sh'}
162-
/>
163-
);
164-
}
165156
return (
166-
<div style={tw`relative my-2`} className="readme-code-block">
167-
<pre className="shiki">{children}</pre>
168-
</div>
157+
<MarkdownCodeBlock
158+
code={children.props.children}
159+
theme={(tw.prefixMatch('dark') ? rndDark : rndLight) as Theme}
160+
lang={langClass ? (langClass.split('-')[1] ?? 'sh').toLowerCase() : 'sh'}
161+
/>
169162
);
170163
},
171164
blockquote: ({ children }: any) => {

0 commit comments

Comments
 (0)