Vanessa 2024-12-24 19:49:21 +08:00
parent 5b3fa67332
commit 190fa7f8c4
3 changed files with 15 additions and 7 deletions

View file

@ -329,7 +329,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
id: "copyBlockRef",
iconHTML: "",
label: window.siyuan.languages.copyBlockRef,
click: async () => {
click: () => {
let text = "";
for (let i = 0; i < ids.length; i++) {
const id = ids[i];
@ -338,8 +338,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
if (cellElement.getAttribute("data-detached") === "true") {
content = cellElement.querySelector(".av__celltext").textContent;
} else {
const response = await fetchSyncPost("/api/block/getRefText", {id});
content = `((${id} '${response.data}'))`;
content = `((${id} '${cellElement.querySelector(".av__celltext").textContent}'))`;
}
if (ids.length > 1) {
text += "* ";
@ -399,7 +398,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
id: "copyProtocolInMd",
iconHTML: "",
label: window.siyuan.languages.copyProtocolInMd,
click: async () => {
click: () => {
let text = "";
for (let i = 0; i < ids.length; i++) {
const id = ids[i];
@ -408,8 +407,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
if (cellElement.getAttribute("data-detached") === "true") {
content = cellElement.querySelector(".av__celltext").textContent;
} else {
const response = await fetchSyncPost("/api/block/getRefText", {id});
content = `[${response.data}](siyuan://blocks/${id})`;
content = `[${cellElement.querySelector(".av__celltext").textContent}](siyuan://blocks/${id})`;
}
if (ids.length > 1) {
text += "* ";