From b63b9772324f445c0f67f80055259ffc68dc9470 Mon Sep 17 00:00:00 2001 From: Bruno Quaresma Date: Fri, 9 Dec 2022 20:44:00 +0000 Subject: [PATCH 1/3] chodre: Add react-syntax-highlight back --- site/package.json | 2 ++ site/yarn.lock | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/site/package.json b/site/package.json index dc9457a0da627..6a6f323d7a7e0 100644 --- a/site/package.json +++ b/site/package.json @@ -64,6 +64,7 @@ "react-i18next": "12.0.0", "react-markdown": "8.0.3", "react-router-dom": "6.4.1", + "react-syntax-highlighter": "15.5.0", "remark-gfm": "3.0.1", "sourcemapped-stacktrace": "1.1.11", "tzdata": "1.0.30", @@ -93,6 +94,7 @@ "@types/react": "18.0.15", "@types/react-dom": "18.0.6", "@types/react-helmet": "6.1.5", + "@types/react-syntax-highlighter": "15.5.5", "@types/semver": "7.3.12", "@types/superagent": "4.1.15", "@types/ua-parser-js": "0.7.36", diff --git a/site/yarn.lock b/site/yarn.lock index f12e781f26c37..43dec0c2c0442 100644 --- a/site/yarn.lock +++ b/site/yarn.lock @@ -3214,6 +3214,13 @@ dependencies: "@types/react" "*" +"@types/react-syntax-highlighter@15.5.5": + version "15.5.5" + resolved "https://registry.yarnpkg.com/@types/react-syntax-highlighter/-/react-syntax-highlighter-15.5.5.tgz#4d3b51f8956195f1f63360ff03f8822c5d74c516" + integrity sha512-QH3JZQXa2usAvJvSsdSUJ4Yu4j8ReuZpgRrEW+XP+Rmosbn425YshW9iGEb/pAARm8496axHhHUPRH3UmTiB6A== + dependencies: + "@types/react" "*" + "@types/react-transition-group@^4.2.0": version "4.4.5" resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.5.tgz#aae20dcf773c5aa275d5b9f7cdbca638abc5e416" @@ -11752,7 +11759,7 @@ react-router@6.4.1: dependencies: "@remix-run/router" "1.0.1" -react-syntax-highlighter@^15.4.5: +react-syntax-highlighter@15.5.0, react-syntax-highlighter@^15.4.5: version "15.5.0" resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-15.5.0.tgz#4b3eccc2325fa2ec8eff1e2d6c18fa4a9e07ab20" integrity sha512-+zq2myprEnQmH5yw6Gqc8lD55QHnpKaU8TOcFeC/Lg/MQSs8UknEA0JC4nTZGFAXC2J2Hyj/ijJ7NlabyPi2gg== From eee762bf847d0f3ade8fe115d88f2359911fdbed Mon Sep 17 00:00:00 2001 From: Bruno Quaresma Date: Fri, 9 Dec 2022 21:17:57 +0000 Subject: [PATCH 2/3] Fix type --- site/src/components/Markdown/Markdown.tsx | 7 ++++--- site/yarn.lock | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/site/src/components/Markdown/Markdown.tsx b/site/src/components/Markdown/Markdown.tsx index fece615c4af03..639d0257067af 100644 --- a/site/src/components/Markdown/Markdown.tsx +++ b/site/src/components/Markdown/Markdown.tsx @@ -11,7 +11,7 @@ import ReactMarkdown from "react-markdown" import { Prism as SyntaxHighlighter } from "react-syntax-highlighter" import gfm from "remark-gfm" import { colors } from "theme/colors" -import darcula from "react-syntax-highlighter/dist/cjs/styles/prism/darcula" +import { darcula } from "react-syntax-highlighter/dist/cjs/styles/prism" export interface MarkdownProps { children: string @@ -41,13 +41,14 @@ export const Markdown: FC<{ children: string }> = ({ children }) => { return
{children}
}, - code: ({ node, inline, className, children, ...props }) => { + code: ({ node, inline, className, children, style, ...props }) => { const match = /language-(\w+)/.exec(className || "") return !inline && match ? ( Date: Mon, 12 Dec 2022 01:49:35 +0000 Subject: [PATCH 3/3] update the lock and make it build again --- site/yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/yarn.lock b/site/yarn.lock index 43ee3db772787..43dec0c2c0442 100644 --- a/site/yarn.lock +++ b/site/yarn.lock @@ -11759,7 +11759,7 @@ react-router@6.4.1: dependencies: "@remix-run/router" "1.0.1" -react-syntax-highlighter@15.5.5, react-syntax-highlighter@^15.4.5: +react-syntax-highlighter@15.5.0, react-syntax-highlighter@^15.4.5: version "15.5.0" resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-15.5.0.tgz#4b3eccc2325fa2ec8eff1e2d6c18fa4a9e07ab20" integrity sha512-+zq2myprEnQmH5yw6Gqc8lD55QHnpKaU8TOcFeC/Lg/MQSs8UknEA0JC4nTZGFAXC2J2Hyj/ijJ7NlabyPi2gg==