mirror of
https://github.com/dergigi/boris.git
synced 2026-01-20 15:24:58 +01:00
feat: add Prism.js syntax highlighting for code blocks
- Install prismjs and rehype-prism-plus packages - Integrate rehype-prism plugin into ReactMarkdown - Use prism-tomorrow dark theme for syntax highlighting - Enhanced code block styling with better padding and borders - Inline code now has distinct styling from code blocks - Monospace font for all code (Monaco, Menlo, Consolas) - Improved readability with proper line-height and spacing
This commit is contained in:
@@ -2,7 +2,9 @@ import React, { useMemo, useState, useEffect } from 'react'
|
||||
import ReactMarkdown from 'react-markdown'
|
||||
import remarkGfm from 'remark-gfm'
|
||||
import rehypeRaw from 'rehype-raw'
|
||||
import rehypePrism from 'rehype-prism-plus'
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
import 'prismjs/themes/prism-tomorrow.css'
|
||||
import { faSpinner, faCheck } from '@fortawesome/free-solid-svg-icons'
|
||||
import { RelayPool } from 'applesauce-relay'
|
||||
import { IAccount } from 'applesauce-accounts'
|
||||
@@ -219,7 +221,7 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
|
||||
<div ref={markdownPreviewRef} style={{ display: 'none' }}>
|
||||
<ReactMarkdown
|
||||
remarkPlugins={[remarkGfm]}
|
||||
rehypePlugins={[rehypeRaw]}
|
||||
rehypePlugins={[rehypeRaw, rehypePrism]}
|
||||
components={{
|
||||
img: ({ src, alt, ...props }) => (
|
||||
<img
|
||||
|
||||
Reference in New Issue
Block a user