mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +01:00
This commit is contained in:
parent
57f95b1d59
commit
7c12d293ee
2 changed files with 4 additions and 15 deletions
|
|
@ -151,11 +151,10 @@ export const setRefDynamicText = (data: {
|
|||
"rootID": string
|
||||
}) => {
|
||||
getAllEditor().forEach(item => {
|
||||
if (item.protyle.block.rootID === data.rootID) {
|
||||
const refElement = item.protyle.wysiwyg.element.querySelector(`[data-node-id="${data.blockID}"] span[data-type="block-ref"][data-subtype="d"][data-id="${data.defBlockID}"]`);
|
||||
if (refElement) {
|
||||
refElement.innerHTML = data.refText;
|
||||
}
|
||||
// 不能对比 rootId,否则潜入块中的锚文本无法更新
|
||||
const refElement = item.protyle.wysiwyg.element.querySelector(`[data-node-id="${data.blockID}"] span[data-type="block-ref"][data-subtype="d"][data-id="${data.defBlockID}"]`);
|
||||
if (refElement) {
|
||||
refElement.innerHTML = data.refText;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue