mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-23 05:33:08 +03:00
fix(core): should wrap link text (#8249)
Closes [BS-1418](https://linear.app/affine-design/issue/BS-1418/link-to-block-粘贴识别后,使用-undo-来撤销操作的效果不一样) https://github.com/user-attachments/assets/537cf8f4-cf13-466f-b68e-fc213891c548
This commit is contained in:
parent
5e56ec65e3
commit
85448e2d6b
@ -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(() => {
|
||||
|
@ -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(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user