fix: 修复 wangEditor 布局、预览、图片上传和链接样式

- 修复编辑区高度未撑满问题
- 预览改用 getHtml() 直接展示
- 图片上传改用 fetch + credentials:same-origin(修复 CSRF 403)
- 添加帖子正文链接蓝色+下划线样式
- 草稿改用 getHtml() 保存,恢复时正确还原格式
- 草稿改为每 300 字 + 停笔 10 秒双重触发
- 空编辑区不保存草稿
- 代码块语言标签通过 DOMParser 注入(编辑器 + 预览)
This commit is contained in:
2026-05-27 23:01:59 +08:00
parent 9d17185e11
commit ec8fa3eb56
3 changed files with 217 additions and 53 deletions

View File

@ -8,6 +8,7 @@
flex-direction: column;
overflow: hidden;
min-height: 0;
height: 100%;
}
#toolbar-container {
flex-shrink: 0;
@ -16,6 +17,13 @@
flex: 1;
overflow-y: auto;
min-height: 0;
height: 100%;
}
.editor-pane .w-e-text-container {
height: 100% !important;
}
.editor-pane .w-e-text-container [data-slate-editor] {
min-height: 100%;
}
</style>
<body>