replace highlightjs with prismjs

This commit is contained in:
Sebastian Sdorra
2020-06-16 21:04:07 +02:00
parent 7deb300c03
commit a4e6e4186a
9 changed files with 85 additions and 45 deletions

View File

@@ -24,10 +24,9 @@
import React, { FC, useReducer } from "react";
import { Repository, AnnotatedSource, AnnotatedLine } from "@scm-manager/ui-types";
// @ts-ignore
import { LightAsync as ReactSyntaxHighlighter, createElement } from "react-syntax-highlighter";
import { arduinoLight } from "react-syntax-highlighter/dist/cjs/styles/hljs";
import { PrismAsyncLight as ReactSyntaxHighlighter, createElement } from "react-syntax-highlighter";
import { ghcolors } from "react-syntax-highlighter/dist/esm/styles/prism";
import { DateInput } from "../../dates";
import Popover from "./Popover";
import AnnotateLine from "./AnnotateLine";
@@ -145,7 +144,7 @@ const Annotate: FC<Props> = ({ source, repository, baseDate }) => {
<ReactSyntaxHighlighter
showLineNumbers={false}
language={source.language}
style={arduinoLight}
style={ghcolors}
renderer={defaultRenderer}
>
{code}