P2 | markdown.rs 多个 comrak 节点类型 fallthrough 到 _ => None #48

Closed
opened 2026-06-06 12:33:48 +08:00 by wangdl · 1 comment
Owner

背景

collect_blocks 的 match 中 FrontMatter、FootnoteDefinition 等节点类型落到了 _ => None 分支,内容被静默丢弃。虽然这些类型在实际文档中少见,但应至少记录为可见块。

需要处理的节点

  • NodeValue::FrontMatter — 应暴露为 CodeBlock(language=Some("yaml"))
  • NodeValue::FootnoteDefinition — 应暴露为 Paragraph

位置

crates/zx_document_core/src/markdown.rs:149-160

## 背景 collect_blocks 的 match 中 FrontMatter、FootnoteDefinition 等节点类型落到了 _ => None 分支,内容被静默丢弃。虽然这些类型在实际文档中少见,但应至少记录为可见块。 ## 需要处理的节点 - NodeValue::FrontMatter — 应暴露为 CodeBlock(language=Some("yaml")) - NodeValue::FootnoteDefinition — 应暴露为 Paragraph ## 位置 crates/zx_document_core/src/markdown.rs:149-160
wangdl added this to the M6:Code Review 质量完善(2026-06-06) milestone 2026-06-06 12:33:48 +08:00
Author
Owner

修复完成 (2026-06-06)

实现

  • NodeValue::FrontMatter(content)CodeBlock(language=yaml)
  • NodeValue::FootnoteDefinitionParagraph(收集子文本)

状态

已修复。

## 修复完成 (2026-06-06) ### 实现 - `NodeValue::FrontMatter(content)` → `CodeBlock(language=yaml)` - `NodeValue::FootnoteDefinition` → `Paragraph`(收集子文本) ### 状态 ✅ 已修复。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wangdl/zhixi-document-runtime#48
No description provided.