fundon
2024-09-13 11:44:23 +00:00
parent 5e56ec65e3
commit 85448e2d6b
2 changed files with 2 additions and 5 deletions

View File

@@ -73,14 +73,13 @@ function createCopyLinkToBlockMenuItem(
if (!str) return; if (!str) return;
const type = model.flavour; const type = model.flavour;
const title = editor.doc.title$.value;
const page = editor.editorContainer$.value; const page = editor.editorContainer$.value;
page?.host?.std.clipboard page?.host?.std.clipboard
.writeToClipboard(items => { .writeToClipboard(items => {
items['text/plain'] = str; items['text/plain'] = str;
// wrap a link // wrap a link
items['text/html'] = `<a title="${title}" href="${str}">${title}</a>`; items['text/html'] = `<a href="${str}">${str}</a>`;
return items; return items;
}) })
.then(() => { .then(() => {

View File

@@ -114,13 +114,11 @@ function createCopyLinkToBlockMenuItem(
return; return;
} }
const title = editor.doc.title$.value;
ctx.std.clipboard ctx.std.clipboard
.writeToClipboard(items => { .writeToClipboard(items => {
items['text/plain'] = str; items['text/plain'] = str;
// wrap a link // wrap a link
items['text/html'] = `<a title="${title}" href="${str}">${title}</a>`; items['text/html'] = `<a href="${str}">${str}</a>`;
return items; return items;
}) })
.then(() => { .then(() => {