Skip to content

Commit

Permalink
🎨 #12020
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Sep 4, 2024
1 parent ba27dd6 commit 3ba4eb7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions app/src/protyle/hint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,13 @@ ${unicode2Emoji(emoji.unicode)}</button>`;
<span class="b3-list-item__text">${window.siyuan.languages.newFile} <mark>${response.data.k}</mark></span></div></button>`;
}
response.data.blocks.forEach((item: IBlock, index: number) => {
const blockRefHTML = `<span data-type="block-ref" data-id="${item.id}" data-subtype="s">${oldValue}</span>`;
let blockRefHTML;
if (source === "av") {
// av 搜索时需要获取值 https://github.com/siyuan-note/siyuan/issues/12020
blockRefHTML = `<span data-type="block-ref" data-id="${item.id}" data-subtype="s">${item.name || item.refText.replace(new RegExp(Constants.ZWSP, "g"), "")}</span>`;
} else {
blockRefHTML = `<span data-type="block-ref" data-id="${item.id}" data-subtype="s">${oldValue}</span>`;
}
searchHTML += `<button style="width: calc(100% - 16px)" class="b3-list-item b3-list-item--two${index === 0 ? " b3-list-item--focus" : ""}" data-value="${encodeURIComponent(blockRefHTML)}">
${genHintItemHTML(item)}
</button>`;
Expand Down Expand Up @@ -481,7 +487,10 @@ ${genHintItemHTML(item)}
updateAttrViewCellAnimation(cellElement, {
type: "block",
isDetached: false,
block: {content: tempElement.textContent, id: sourceId}
block: {
content: tempElement.textContent,
id: sourceId
}
});
}
return;
Expand Down

0 comments on commit 3ba4eb7

Please sign in to comment.