chore: 工具链升级到最新版本(Vite 8 / React 19 / react-router 8 / TS 7 / Go 1.26 依赖更新)
- 前端:vite ^8.2.2、react/react-dom ^19.2.8、react-router ^8.3.1(移除 react-router-dom)、typescript ^7.0.2、zustand ^5.0.15;适配升级带来的类型变化(react-hook-form Resolver、ProseMirror node.parent、tiptap focus 参数、timer undefined 等) - 后端:升级 gin/jwt/minio-go/gorm/modernc-sqlite/x-crypto 等直接依赖至最新;gowebp v0.1.1 已是最新版本 - tsconfig 移除 baseUrl,paths 改为相对路径以兼容 TS7
This commit is contained in:
@@ -10,8 +10,8 @@ const GATED_BLOCK_RE = /<(members-only|reply-only)(?:\s[^>]*)?>([\s\S]*?)<\/\1>/
|
||||
const TURNDOWN_OPTIONS = {
|
||||
headingStyle: 'atx' as const,
|
||||
codeBlockStyle: 'fenced' as const,
|
||||
emDelimiter: '*',
|
||||
bulletListMarker: '-',
|
||||
emDelimiter: '*' as const,
|
||||
bulletListMarker: '-' as const,
|
||||
};
|
||||
|
||||
/** 仅去除区块首尾空行,保留各行行首缩进 */
|
||||
@@ -135,7 +135,7 @@ function addTurndownContentRules(service: TurndownService): void {
|
||||
});
|
||||
|
||||
service.addRule('strikethrough', {
|
||||
filter: ['del', 's', 'strike'],
|
||||
filter: (node) => ['DEL', 'S', 'STRIKE'].includes(node.nodeName),
|
||||
replacement: (content) => `~~${content}~~`,
|
||||
});
|
||||
|
||||
@@ -234,12 +234,12 @@ function gatedBlockToMarkdown(tag: 'members-only' | 'reply-only', node: HTMLElem
|
||||
}
|
||||
|
||||
turndown.addRule('membersOnly', {
|
||||
filter: 'members-only',
|
||||
filter: (node) => node.nodeName === 'MEMBERS-ONLY',
|
||||
replacement: (_content, node) => gatedBlockToMarkdown('members-only', node as HTMLElement),
|
||||
});
|
||||
|
||||
turndown.addRule('replyOnly', {
|
||||
filter: 'reply-only',
|
||||
filter: (node) => node.nodeName === 'REPLY-ONLY',
|
||||
replacement: (_content, node) => gatedBlockToMarkdown('reply-only', node as HTMLElement),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user