From 0f0f2c1b8117ad36e64b6340dcd17d27e2a30119 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Sun, 14 Jul 2024 15:40:10 -0600 Subject: [PATCH] feat: Update react-syntax-highlighter to latest version and use a11yDark style This commit updates the react-syntax-highlighter package to the latest version and switches to the a11yDark style for syntax highlighting in the MarkdownViewer component. This update ensures compatibility with the latest features and improvements of react-syntax-highlighter and enhances the accessibility of the code snippets in the MarkdownViewer. --- .../Markdown.tsx/MarkdownViewer.tsx | 24 +++++++++++-------- Copilot/Init.ts | 2 +- Copilot/Utils/CodeRepository.ts | 20 ++++++++++++---- .../CodeRepository/PullRequestView.tsx | 7 ++++-- .../src/Components/Copilot/LastRunMessage.tsx | 2 +- docker-compose.base.yml | 1 + docker-compose.dev.yml | 2 -- 7 files changed, 37 insertions(+), 21 deletions(-) diff --git a/CommonUI/src/Components/Markdown.tsx/MarkdownViewer.tsx b/CommonUI/src/Components/Markdown.tsx/MarkdownViewer.tsx index 8139fa660c..e851d4c480 100644 --- a/CommonUI/src/Components/Markdown.tsx/MarkdownViewer.tsx +++ b/CommonUI/src/Components/Markdown.tsx/MarkdownViewer.tsx @@ -3,9 +3,8 @@ import React, { FunctionComponent, ReactElement } from "react"; import ReactMarkdown from "react-markdown"; // https://github.com/remarkjs/remark-gfm import remarkGfm from "remark-gfm"; -import {Prism as SyntaxHighlighter} from 'react-syntax-highlighter' -import {dark} from 'react-syntax-highlighter/dist/esm/styles/prism' - +import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; +import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; export interface ComponentProps { text: string; @@ -78,23 +77,28 @@ const MarkdownViewer: FunctionComponent = ( ul: ({ ...props }: any) => { return