Skip to content

Commit c9839ee

Browse files
committed
remove classname lang extraction
1 parent 58d40e0 commit c9839ee

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

packages/dev/s2-docs/src/Code.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ type Links = {[name: string]: string};
5656
export interface ICodeProps {
5757
children: string,
5858
lang?: string,
59-
className?: string,
6059
isFencedBlock?: boolean,
6160
hideImports?: boolean,
6261
links?: Links,
@@ -69,15 +68,7 @@ function isSupportedLanguage(lang: string): boolean {
6968
return supported.includes(lang.toLowerCase());
7069
}
7170

72-
export function Code({children, lang, className, isFencedBlock, hideImports = true, links, styles}: ICodeProps) {
73-
// Extract language from className if lang not provided (MDX passes className="language-xxx")
74-
if (!lang && className) {
75-
const match = className.match(/language-(\w+)/);
76-
if (match) {
77-
lang = match[1];
78-
}
79-
}
80-
71+
export function Code({children, lang, isFencedBlock, hideImports = true, links, styles}: ICodeProps) {
8172
// If language is provided and is a supported syntax highlighting language
8273
if (lang && isSupportedLanguage(lang)) {
8374
return (

0 commit comments

Comments
 (0)