小改动

This commit is contained in:
宇阳
2024-12-29 00:24:56 +08:00
parent 369949513b
commit 41e61bcdae
2 changed files with 9 additions and 19 deletions

View File

@@ -6,9 +6,7 @@ import { baseURL } from '@/utils/request';
import { useUserStore } from '@/stores';
import { Editor } from '@bytemd/react';
import gfm from '@bytemd/plugin-gfm'
import gemoji from '@bytemd/plugin-gemoji'
import highlight from '@bytemd/plugin-highlight';
import plugins from './plugins';
import 'highlight.js/styles/vs2015.css';
import 'bytemd/dist/index.css';
import zh from 'bytemd/lib/locales/zh_Hans.json';
@@ -20,12 +18,6 @@ interface Props {
onChange: (value: string) => void;
}
const plugins = [
gfm(),
gemoji(),
highlight()
];
const EditorMD = ({ value, onChange }: Props) => {
const store = useUserStore();
const [loading, setLoading] = useState(false)

View File

@@ -22,7 +22,7 @@ const markers = (): BytemdPlugin => {
remark: (processor) => processor.use(remarkFlexibleMarkers),
actions: [
{
title: 'markers',
title: '标记',
icon: markerSvg,
handler: {
type: 'action',
@@ -50,13 +50,13 @@ const callouts = (): BytemdPlugin => {
icon: calloutSvg,
handler: {
type: 'dropdown',
actions: calloutTypes.map(type => ({
title: type.title,
icon: type.icon,
actions: calloutTypes.map(({ title, icon, blockType }) => ({
title,
icon,
handler: {
type: 'action',
click: (ctx) => {
ctx.appendBlock(`> ${type.blockType} ${type.title}\n> `);
ctx.appendBlock(`> ${blockType} ${title}\n> `);
}
}
}))
@@ -66,13 +66,11 @@ const callouts = (): BytemdPlugin => {
}
}
const plugins = [
export default [
gfm({ singleTilde: false }),
markers(),
// markers(),
gemoji(),
math(),
highlight(),
callouts()
]
export default plugins;
];