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
@@ -828,6 +828,10 @@ pub(crate) fn render_editor_island_adapter_script() -> &'static str {
return '';
};
// 过渡适配(TODO step-4):legacy→Tiptap inline marks 转换函数组。
// AST/block 迁移 complete 后,前端应直接消费 block document 中的
// tiptap 格式 marks(已由 Rust 侧 local_markdown_parser 输出),
// 不再需要此 JS 侧样式→marks 适配层。
const legacyStylesToTiptapMarks = (styles) => {
if (!styles || typeof styles !== 'object') return [];
const marks = [];
@@ -5153,6 +5157,10 @@ mod tests {
assert!(html.contains("legacyStylesToTiptapMarks"));
assert!(html.contains("legacyMarkArrayToTiptapMarks"));
assert!(html.contains("firstNonEmptyText(block?.props?.sourcePath"));
assert!(html.contains("marks.push({ type: 'bold' })"));
assert!(html.contains("marks.push({ type: 'italic' })"));
assert!(html.contains("marks.push({ type: 'underline' })"));
assert!(html.contains("marks.push({ type: 'strike' })"));
assert!(html.contains("marks.push({ type: 'code' })"));
assert!(html.contains("marks.push({ type: 'link', attrs: { href } })"));
assert!(html.contains("styles.link = href"));