Commit f13e58fd by pangchong

fix: 防止树节点副标题递归获取并拼接任何子节点的文本内容,避免全局出现重复

parent 16b2c0bb
...@@ -189,13 +189,8 @@ export function useNodeTree( ...@@ -189,13 +189,8 @@ export function useNodeTree(
.map((item) => { .map((item) => {
if (item.type === 'text') { if (item.type === 'text') {
return item.text || '' return item.text || ''
} else if (item.type === 'element' && item.nodeId) {
if (n.tagName === 'REFBLOCK') {
return ''
}
const child = n.children.find((c) => c.id === item.nodeId)
return child ? getFullText(child) : ''
} }
// 避免递归获取子元素的文本内容,因为子元素在树结构中会作为独立节点展示
return '' return ''
}) })
.join('') .join('')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment