Skip to content

Commit eee762b

Browse files
committed
Fix type
1 parent b63b977 commit eee762b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

site/src/components/Markdown/Markdown.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import ReactMarkdown from "react-markdown"
1111
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"
1212
import gfm from "remark-gfm"
1313
import { colors } from "theme/colors"
14-
import darcula from "react-syntax-highlighter/dist/cjs/styles/prism/darcula"
14+
import { darcula } from "react-syntax-highlighter/dist/cjs/styles/prism"
1515

1616
export interface MarkdownProps {
1717
children: string
@@ -41,13 +41,14 @@ export const Markdown: FC<{ children: string }> = ({ children }) => {
4141
return <pre>{children}</pre>
4242
},
4343

44-
code: ({ node, inline, className, children, ...props }) => {
44+
code: ({ node, inline, className, children, style, ...props }) => {
4545
const match = /language-(\w+)/.exec(className || "")
4646

4747
return !inline && match ? (
4848
<SyntaxHighlighter
4949
style={darcula}
50-
language={match[1]}
50+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- this can be undefined
51+
language={match[1] ?? "language-shell"}
5152
useInlineStyles={false}
5253
// Use inline styles does not work correctly
5354
// https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/329

site/yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11759,7 +11759,7 @@ react-router@6.4.1:
1175911759
dependencies:
1176011760
"@remix-run/router" "1.0.1"
1176111761

11762-
react-syntax-highlighter@15.5.0, react-syntax-highlighter@^15.4.5:
11762+
react-syntax-highlighter@15.5.5, react-syntax-highlighter@^15.4.5:
1176311763
version "15.5.0"
1176411764
resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-15.5.0.tgz#4b3eccc2325fa2ec8eff1e2d6c18fa4a9e07ab20"
1176511765
integrity sha512-+zq2myprEnQmH5yw6Gqc8lD55QHnpKaU8TOcFeC/Lg/MQSs8UknEA0JC4nTZGFAXC2J2Hyj/ijJ7NlabyPi2gg==

0 commit comments

Comments
 (0)