feat(Markdown): add inline highlighting

This commit is contained in:
Rairn 2023-03-23 12:26:27 +08:00
parent 2d5822dfa6
commit 972e05bac0
3 changed files with 8 additions and 2 deletions

View File

@ -19,6 +19,12 @@
padding: 3px 5px padding: 3px 5px
} }
:not(pre) code {
padding: 2px 5px;
color: #d56161;
background: #f6f7f9;
}
blockquote { blockquote {
border-left: 4px solid #ccc; border-left: 4px solid #ccc;
padding-left: 20px; padding-left: 20px;

View File

@ -1,6 +1,8 @@
import MarkdownIt from 'markdown-it'; import MarkdownIt from 'markdown-it';
import markdownItHighlightjs from 'markdown-it-highlightjs'; import markdownItHighlightjs from 'markdown-it-highlightjs';
import mermaidPlugin from './markdown-it-plugins/mermaidPlugin'; import mermaidPlugin from './markdown-it-plugins/mermaidPlugin';
import './highlight-theme/default.less';
import './highlight-theme/table.less';
const md = new MarkdownIt({ const md = new MarkdownIt({
html: true, html: true,

View File

@ -1,6 +1,4 @@
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import './highlight-theme/default.less';
import './highlight-theme/table.less';
export async function parseMarkdown(text: string) { export async function parseMarkdown(text: string) {
if (!text) { if (!text) {