mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
This commit is contained in:
parent
5e88631c1b
commit
b3c423afc6
2 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue