Pin the component library at 508cc55: Markdown reads with markdown-rs

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-11 23:23:27 -04:00
1 parent ef6dd7e06b
commit 4183f729d1
7 files changed
+35 -6

No files matched your search

+1 -1
View File
@@ -98,7 +98,7 @@
用户 2026-10-11 定:ElyMark 不用 CEF,不用 Electron。界面用 Ely-GPUI-Components 的 Markdown 组件(`documents::MarkdownEditor` 一族,缺的在组件库补并推到 Gitea),解析用 markdown-rs,公式用 RaTeX,Mermaid 用 mermaid-rs-renderer,PDF 用 MuPDF Story。删去 CEF 与网页内容,ElyMail 也不用 CEF 与 Electron。旧 C14.0 至 C14.7(CEF 实现)作废,记录在 git 历史。
- [x] C14.0 前置:`reference/` 加 markion 与 markdown-rs 并钉提交;`scripts/review.sh` 照用户新定(gpt-6.1-sol,effort high,fast,每条最多三轮) — R2 ok
- [ ] C14.1 组件库:`MarkdownRenderer`、`MarkdownEditor`、Markdown 着色、块范围、大纲与链接查找改用 markdown-rs(`documents` 的 `tree`、`markdown`、`render`);`BlockEditor` 的导入导出不属 ElyMark,仍用 pulldown-cmark;原有测试照过,改了语义的测试写明 markdown-rs 的读法;推送,ElyOffice 钉新提交
- [x] C14.1 组件库:`MarkdownRenderer`、`MarkdownEditor`、Markdown 着色、块范围、大纲与链接查找改用 markdown-rs(`documents` 的 `tree`、`markdown`、`render`);`BlockEditor` 的导入导出不属 ElyMark,仍用 pulldown-cmark;原有测试照过,改了语义的测试写明 markdown-rs 的读法;推送,ElyOffice 钉新提交 — R2 ok
- [ ] C14.2 组件库:公式与 Mermaid(MARK-04)。`typography::Latex` 改由 RaTeX 排出;Mermaid 由 mermaid-rs-renderer 画成图;画不出即显示错误与原文;`MarkdownRenderer` 用二者,本地图片按属主给的文件夹读,网络图片不自动载入
- [ ] C14.3 组件库:文件级 Markdown 文档组件。一个 `CodeEditor` 持全文与撤销;可视(变高虚拟列表,逐块渲染,按下的块开成源码,写回为一步撤销)、源码(`CodeEditor` 加 Markdown 着色)、预览(只读);属主可读写文本、模式、插入点行列、滚动,可跳到行;改动发事件
- [ ] C14.4 ElyMark 文件会话改为原生(MARK-01,§14.3,QA-21):视图换成 C14.3 的组件,文本即文件原文,无序列化;BOM、CRLF 照旧;新建、打开、保存、另存、重命名照旧;应用不再依赖 `ely-web-content`
+11
View File
@@ -0,0 +1,11 @@
FAIL
1. ../Ely-GPUI-Components/src/documents/tree.rs:70 — Reference definitions are collected only from root children, although markdown-rs resolves references against definitions nested anywhere. Rendering `[site]\n\n> [site]: https://ely.dev\n` (also with a list instead of the quote) panics at `Reader::url` with “a reference names a definition”; `outline` also calls this parser. Recursively collect definitions in document order before reading blocks, keeping the first definition, and test nested link/image definitions. Both probes fail at fcad0ff and pass at its parent; see `.work/c14.1-probes.log` and `.work/c14.1-baseline-probes.log`.
2. ../Ely-GPUI-Components/src/documents/tree.rs:213 — Images inside inline containers silently become their alt text. For `*![alt](image.png)*`, parsing returns an emphasized paragraph containing `alt` and no image, whereas the parent commit produces an image. This breaks CommonMark image rendering (MARK-03); linked images have the same loss. Handle images recursively through emphasis, strong and link containers instead of replacing them with text, with regression tests.
3. ../Ely-GPUI-Components/src/documents/tree.rs:205 — Soft breaks replace only LF, leaving CR from Windows line endings in displayed text. `one\r\ntwo` becomes `one\r two`, and `one\rtwo` remains unchanged, instead of the CommonMark soft-break result `one two`. Normalize CRLF and standalone CR soft breaks as well, preserving hard-break and code semantics, and test all three line-ending forms. Both probes pass on the parent and fail at fcad0ff (`.work/c14.1-probes.log`), contradicting the documented soft-break behavior and PRD §14.3.
4. ../Ely-GPUI-Components/src/documents/markdown.rs:96 — The highlighter handles `Link` but omits markdown-rs `LinkReference`, regressing reference-link styling. For `[site]\n\n[site]: https://ely.dev\n`, `marks` now returns no link mark; the parent styles `[site]` as a link. Handle full, collapsed and shortcut reference links and their syntax spans, and add assertions for them. The reference-link probe fails only at fcad0ff; the existing 1731 library tests all pass and miss this case (`.work/c14.1-tests-retry.log`).
5. ../Ely-GPUI-Components/src/documents/markdown.rs:9 — Four added comments exceed the explicit ten-word limit: this line has 11 words, markdown.rs:188 has 13, tree.rs:98 has 12, and tree.rs:159 has 15. Counting the added comments reproduces the rule violation (`.work/c14.1-comments.log`). Shorten or remove these comments.
+1
View File
@@ -0,0 +1 @@
PASS