mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-02 19:00:15 +01:00
🎨 没有选中文本粘贴链接不应选中整个链接
This commit is contained in:
parent
2aeaecf78c
commit
4244c18779
2 changed files with 6 additions and 2 deletions
|
|
@ -544,10 +544,14 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
|
|||
}
|
||||
}
|
||||
if (linkElement) {
|
||||
const selectText = range.toString();
|
||||
protyle.toolbar.setInlineMark(protyle, "a", "range", {
|
||||
type: "a",
|
||||
color: `${linkElement.getAttribute("href")}${Constants.ZWSP}${range.toString()}`
|
||||
color: `${linkElement.getAttribute("href")}${Constants.ZWSP}${selectText || linkElement.textContent}`
|
||||
});
|
||||
if (!selectText) {
|
||||
range.collapse(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
fetchPost("/api/lute/html2BlockDOM", {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue