Fix markdown library incompatibility; fix 404

Signed-off-by: Paul W. <lambdapaul@protonmail.com>
This commit is contained in:
2023-10-30 00:55:45 -04:00
parent 35d56f5cde
commit d3591c4db6
4 changed files with 35 additions and 21 deletions

View File

@@ -4,8 +4,8 @@ import SyntaxHighlighter from 'react-syntax-highlighter';
import { monokaiSublime as hlTheme } from 'react-syntax-highlighter/dist/cjs/styles/hljs';
import remarkGfm from 'remark-gfm';
import rehypeRaw from 'rehype-raw';
import readMarkdown from '../../lib/read-markdown';
import readMarkdown from '../../lib/read-markdown';
import NotesInfo from '../../public/notes.json';
interface Note {
@@ -22,9 +22,9 @@ function Markdown({ content }: any) {
remarkPlugins={[remarkGfm]}
rehypePlugins={[rehypeRaw]}
components={{
code({ node, inline, className, children, ...props }) {
code({ node, className, children, ...props }) {
const match = /language-(\w+)/.exec(className || '')
return !inline && match
return match
? (
<SyntaxHighlighter
showLineNumbers={true}