// 正文中的占位符标记
interface ContentPlaceholder {
id: string; // 占位符 ID
nodeId: string; // 关联的节点 ID
offset: number; // 在正文纯文本中的字符偏移量
label: string; // 显示的标记("①" / "💡" / "●" / "【1】")
color: string; // 节点颜色(用于占位符背景)
}
// 正文渲染时注入占位符
function renderContentWithPlaceholders(
content: string, // Markdown 原文
placeholders: ContentPlaceholder[]
): string {
// 按 offset 排序,在对应位置插入占位符标记
// 渲染为 <span class="placeholder" data-node-id="xxx">①</span>
}
// CSS 透明度控制
.placeholder { opacity: 0.1; transition: opacity 0.2s; }
.placeholder.active { opacity: 1; }
.placeholder:hover { opacity: 0.6; }