Vanessa 2025-03-08 13:00:07 +08:00
parent 5e88631c1b
commit b3c423afc6
2 changed files with 2 additions and 2 deletions

View file

@ -158,7 +158,7 @@ export const setRefDynamicText = (data: {
}) => { }) => {
getAllEditor().forEach(item => { getAllEditor().forEach(item => {
// 不能对比 rootId否则嵌入块中的锚文本无法更新 // 不能对比 rootId否则嵌入块中的锚文本无法更新
item.protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${data.blockID}"] span[data-type="block-ref"][data-subtype="d"][data-id="${data.defBlockID}"]`).forEach(item => { item.protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${data.blockID}"] span[data-type~="block-ref"][data-subtype="d"][data-id="${data.defBlockID}"]`).forEach(item => {
item.innerHTML = data.refText; item.innerHTML = data.refText;
}); });
}); });

View file

@ -239,7 +239,7 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range:
focusBlock(blockElement); focusBlock(blockElement);
} else { } else {
// https://github.com/siyuan-note/siyuan/issues/6087 // https://github.com/siyuan-note/siyuan/issues/6087
realElement.querySelectorAll('[data-type="block-ref"][data-subtype="d"]').forEach(refItem => { realElement.querySelectorAll('[data-type~="block-ref"][data-subtype="d"]').forEach(refItem => {
if (refItem.textContent === "") { if (refItem.textContent === "") {
fetchPost("/api/block/getRefText", {id: refItem.getAttribute("data-id")}, (response) => { fetchPost("/api/block/getRefText", {id: refItem.getAttribute("data-id")}, (response) => {
refItem.innerHTML = response.data; refItem.innerHTML = response.data;