Skip to content

editor: 图片渲染重做 #25

Description

@yexiyue

描述

重做图片 block 渲染,修复图片不显示的问题。Obsidian reveal 风格:非聚焦时渲染图片,光标在图片行时显示原始 Markdown,用 Tailwind 重写样式。

前置依赖

验收标准

  • URL 图片正常渲染(http/https)
  • 本地文件路径图片正常渲染
  • 非聚焦时渲染 <img>,聚焦时显示原始 ![alt](url)
  • 图片居中显示,圆角,最大宽度 100%
  • 加载失败时显示 alt 文本 fallback
  • 点击图片光标移到图片行
  • 用 Tailwind className 替代 EditorView.theme() 样式
  • 亮色/暗色模式下样式正确

技术备注

  • 现有代码:renderBlockImages.ts,基础架构可复用(高度缓存、ViewPlugin、光标行 reveal)
  • 需要排查 WebView 环境下图片不显示的根因(CSP / 文件访问权限 / URL 解析)
  • 先在浏览器 dev 模式排查,再针对 WebView 环境适配

原始文档

查看 Feature 文档

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions