chore: 收口 Batch C 证据与设计口径

This commit is contained in:
lix-2026
2026-05-21 13:28:23 +08:00
parent a0823a7e53
commit b0fa1e53d8
15 changed files with 807 additions and 20 deletions
@@ -6218,6 +6218,9 @@ fn next_available_directory_path(directory: &Path, stem: &str) -> PathBuf {
directory.join(format!("{stem}-{}", std::process::id()))
}
// 过渡实现:写侧手写 Markdown 回写入口函数。当前通过 editor_blocks_to_markdown_with_rewrite
// 将 editor block document 转为 Markdown 文本,AST 迁移 complete 后应替换为
// AST→Markdown 反向映射(见 design/03-rust-web/process/3-13 方案 Step 3)。
fn editor_blocks_to_markdown_for_file(
content: &Value,
root: &Path,
@@ -6387,6 +6390,9 @@ fn stable_hash_hex(value: &str) -> String {
format!("{:016x}", hasher.finish())
}
// 过渡实现:写侧手写 Markdown 回写核心函数。逐 block 遍历,通过
// inline_nodes_to_markdown 将行内节点转为 Markdown 文本。
// AST 迁移 complete 后应替换为 block→Markdown AST→文本 的两次映射。
fn editor_blocks_to_markdown_with_rewrite(
content: &Value,
local_file_context: Option<(&Path, &Path)>,
@@ -6995,6 +7001,9 @@ fn block_content_value(block: &Value) -> Option<&Value> {
block.get("content").or_else(|| block.get("contentNodes"))
}
// 过渡实现:手写行内节点→Markdown 回写函数。从 editor block 的 content 数组中
// 逐个节点提取 text + styles,按 legacy 样式格式输出为内联 Markdown。
// AST + 中间 IR 迁移 complete 后应统一走 MarkdownInline→Markdown 反向映射。
fn inline_nodes_to_markdown(value: &Value) -> String {
if let Some(text) = value.as_str() {
return escape_markdown_inline_text(text);