Skip to content

fix: 渲染并保留原生 HTML,应用图标按 macOS 网格留白 - #8

Merged
quietseek merged 2 commits into
mainfrom
fix/native-html-and-app-icon
Nov 19, 2026
Merged

quietseek merged 2 commits into
mainfrom
fix/native-html-and-app-icon

Conversation

@quietseek

Copy link
Copy Markdown
Owner

原生 HTML

此前 Markdown 中的 HTML 会被 schema 拆散,保存时原始 HTML 丢失(<div align>、<details>、<kbd>、<span style>,<img width> 会变成 ![]() 丢掉宽度)。

  • HTML 块与行内 HTML 作为原子节点按原文保存,编辑区显示渲染效果,写回时逐字不变
  • <details> 等中间有空行的块整体保留,块内 Markdown 一并渲染(与 GitHub 一致)
  • <b>、<sup>、纯文字 <a> 等仍转为可编辑格式;包着图片的 <a>(徽章)保留原文
  • 双击或点击块右上角按钮编辑源码,⌘↵ 保存、Esc 取消、清空即删除
  • 渲染前移除 <script>/<style>/<iframe>、on* 属性与 javascript: 链接;编辑区内点击链接不跳转,⌘/Ctrl 点击用浏览器打开

应用图标

底板铺满 1024 画布,在 Dock / 启动台中比其他应用大一圈。按 macOS 网格改为 824×824 居中并加轻微投影,重新生成 icons.icns、dmg-file-icon.icns、icon.ico、icons.ico。关于窗口用的 frontend/src/assets/icon.png 与 site/ 未改动。

验证

  • npm run typecheck、npm run build 通过
  • vitest 110 个测试通过(新增 tests/html-node.test.ts:往返保留、跨空行块、行内 HTML/注释、徽章、代码内 HTML、段落打断、清洗)
  • 未在真实应用中截图验证(本机无 Chrome),需人工确认显示效果

🤖 Generated with Claude Code

quietseek and others added 2 commits November 18, 2026 20:40
此前 Markdown 中的 HTML 会被 schema 拆散,保存时 <div align>、<details>、<kbd>、带 width 的 <img> 等直接丢失。
现在 HTML 块与行内 HTML 作为原子节点按原文保存,编辑区显示清洗后的渲染效果,双击编辑源码;
<details> 等中间有空行的块整体保留并渲染块内 Markdown,<b>/<sup>/纯文字 <a> 等仍转为可编辑格式。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
底板铺满 1024 画布导致 Dock / 启动台中图标偏大;改为 824×824 居中并加轻微投影,重新生成 icns / ico。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quietseek
quietseek merged commit 24acf72 into main Nov 19, 2026
3 checks passed
@quietseek
quietseek deleted the fix/native-html-and-app-icon branch November 19, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant