fundon 2024-09-13 11:44:23 +00:00
parent 5e56ec65e3
commit 85448e2d6b
No known key found for this signature in database
GPG Key ID: 398BFA91AC539CF7
2 changed files with 2 additions and 5 deletions

View File

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

View File

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