Fix markdown preview breaks and statics image count

This commit is contained in:
LeonspaceX
2026-01-26 23:47:37 +08:00
parent 7ab4dfb9a0
commit 463c793e89
4 changed files with 24 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ import React, { useState, useEffect, useRef, useCallback } from 'react';
import MDEditor from '@uiw/react-md-editor';
// 引入中文指令集
import { getCommands, getExtraCommands } from '@uiw/react-md-editor/commands-cn';
import remarkBreaks from 'remark-breaks';
// 导入编辑器样式
import '@uiw/react-md-editor/markdown-editor.css';
import {
@@ -415,7 +416,7 @@ const CreatePost: React.FC = () => {
commands={commands}
extraCommands={getExtraCommands()}
previewOptions={{
remarkPlugins: [remarkTagPlugin],
remarkPlugins: [remarkTagPlugin, remarkBreaks],
components: {
a: ({ node, ...props }) => {
if (props.href && props.href.startsWith('tag:')) {