From a95b9afd6f8b527410a84e1faf1a7cbba7b722a3 Mon Sep 17 00:00:00 2001 From: Ryan Ling Date: Tue, 17 Oct 2023 14:52:48 +1100 Subject: [PATCH] fix(CodeBlock): Support `diff` highlighting We've been using `diff` code blocks but they lack syntax highlighting: https://developer.seek.com/migration-guides/jobstreet-and-jobsdb-uplift/phase-2-job-posting/ad-selection#option-1-ad-selection-panel --- src/private/Prism.ts | 3 +++ src/storybook/markdown/code.mdx | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/private/Prism.ts b/src/private/Prism.ts index 93c6a96a..02eb7061 100644 --- a/src/private/Prism.ts +++ b/src/private/Prism.ts @@ -2,6 +2,8 @@ import { Prism } from 'prism-react-renderer'; // @ts-ignore import csharpLang from 'refractor/lang/csharp'; // @ts-ignore +import diffLang from 'refractor/lang/diff'; +// @ts-ignore import httpLang from 'refractor/lang/http'; // @ts-ignore import jsonLang from 'refractor/lang/json'; @@ -9,6 +11,7 @@ import jsonLang from 'refractor/lang/json'; import splunkSplLang from 'refractor/lang/splunk-spl'; csharpLang(Prism); +diffLang(Prism); httpLang(Prism); splunkSplLang(Prism); jsonLang(Prism); diff --git a/src/storybook/markdown/code.mdx b/src/storybook/markdown/code.mdx index 297e07e2..b28f58a8 100644 --- a/src/storybook/markdown/code.mdx +++ b/src/storybook/markdown/code.mdx @@ -112,7 +112,7 @@ JSON: GraphQL: ```graphql -query($id: String!) { +query ($id: String!) { candidate(id: $id) { id { value @@ -245,3 +245,10 @@ Width and height: - ```go fmt.Println("this line is loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong") ``` + +--- + +```diff +- removed ++ added +```