Files
DadaoTask/.gitignore
dadao fbdf54cb4c
CI / backend (push) Canceled after 0s
feat(web): 富文本编辑器换成 Vditor,不再自研轮子
上一版我自己写了 textarea + 正则工具栏,看着能用,一到粘贴图片、
中文输入法、撤销栈就露馅——这几样正是成熟组件积累的部分。按要求改成品。

- 编辑器开关 def: RichTextEditor = Vditor 4.0.1(MIT,ir 模式)
  * 运行时资源自托管:web/scripts/vendor-vditor.mjs 把 lute/i18n/icons
    同步到 public/vditor,predev/prebuild 自动执行,不走 unpkg CDN
    (内网会一直卡在加载)
- 只读渲染换 markdown-it + dompurify,删掉自写的正则渲染器
- 附件直链的令牌只在内存里存在:落库前 stripAttachmentTokens,
  渲染/装载前补回(<img> 带不了 Authorization 头,raw?token= 是必要折中)
- Vditor 不会替我们插入 upload.handler 的返回值(只当提示语 tip.show),
  所以上传完自己 insertMD

验证:pytest 70 passed;e2e richtext 13 项、smoke 7、tickets 8、
knowledge 7 全绿;tsc 0 错;主包 299 kB/gzip 75 kB,Vditor 独立
chunk 385 kB 按需加载。
2026-10-29 02:30:10 +08:00

53 lines
863 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Python
__pycache__/
*.py[cod]
.venv/
venv/
.pytest_cache/
.ruff_cache/
.coverage
htmlcov/
*.egg-info/
# 环境与密钥:绝不进仓库
.env
.env.local
*.pem
*.key
# 前端
node_modules/
web/dist/
web/.vite/
*.tsbuildinfo
web/e2e/artifacts/
# 安卓
android/.gradle/
android/build/
android/app/build/
android/local.properties
# 编辑器 / 系统
.DS_Store
.idea/
.vscode/
# pip 安装过程中的临时目录(Windows 上出现在 cwd)
pip-unpack-*/
pip-req-build-*/
tmprfx*
# 本机开发用的便携 PostgreSQL / 临时目录(不入库)
.local/
# Kotlin 编译器诊断日志(构建产物)
android/.kotlin/
# 本地上传文件(附件落盘目录,绝不入库)
backend/var/
# Vditor 运行时资源(lute/i18n/icons,约 3.8 MB)
# 由 web/scripts/vendor-vditor.mjs 从 node_modules 生成,不进版本库
web/public/vditor/