mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-20 22:14:06 +01:00
This commit is contained in:
parent
1f5715201f
commit
7408cfb7da
3 changed files with 50 additions and 15 deletions
|
|
@ -9,7 +9,14 @@ import {getIconByType} from "../../editor/getIcon";
|
|||
import {enterBack, iframeMenu, setFold, tableMenu, videoMenu, zoomOut} from "../../menus/protyle";
|
||||
import {MenuItem} from "../../menus/Menu";
|
||||
import {copySubMenu, openAttr, openWechatNotify} from "../../menus/commonMenuItem";
|
||||
import {copyPlainText, isMac, isOnlyMeta, openByMobile, updateHotkeyTip, writeText} from "../util/compatibility";
|
||||
import {
|
||||
copyPlainText,
|
||||
isMac,
|
||||
isOnlyMeta,
|
||||
openByMobile,
|
||||
updateHotkeyTip,
|
||||
writeText
|
||||
} from "../util/compatibility";
|
||||
import {
|
||||
transaction,
|
||||
turnsIntoOneTransaction,
|
||||
|
|
@ -47,6 +54,7 @@ import {emitOpenMenu} from "../../plugin/EventBus";
|
|||
import {insertAttrViewBlockAnimation} from "../render/av/row";
|
||||
import {avContextmenu} from "../render/av/action";
|
||||
import {openSearchAV} from "../render/av/relation";
|
||||
import {getPlainText} from "../util/paste";
|
||||
|
||||
export class Gutter {
|
||||
public element: HTMLElement;
|
||||
|
|
@ -749,10 +757,8 @@ export class Gutter {
|
|||
accelerator: window.siyuan.config.keymap.editor.general.copyPlainText.custom,
|
||||
click() {
|
||||
let html = "";
|
||||
selectsElement.forEach(item => {
|
||||
item.querySelectorAll("[spellcheck]").forEach(editItem => {
|
||||
html += editItem.textContent + "\n";
|
||||
});
|
||||
selectsElement.forEach((item: HTMLElement) => {
|
||||
html += getPlainText(item) + "\n";
|
||||
});
|
||||
copyPlainText(html.trimEnd());
|
||||
focusBlock(selectsElement[0]);
|
||||
|
|
@ -1223,11 +1229,7 @@ export class Gutter {
|
|||
label: window.siyuan.languages.copyPlainText,
|
||||
accelerator: window.siyuan.config.keymap.editor.general.copyPlainText.custom,
|
||||
click() {
|
||||
let text = "";
|
||||
nodeElement.querySelectorAll("[spellcheck]").forEach(item => {
|
||||
text += item.textContent + "\n";
|
||||
});
|
||||
copyPlainText(text.trimEnd());
|
||||
copyPlainText(getPlainText(nodeElement as HTMLElement).trimEnd());
|
||||
focusBlock(nodeElement);
|
||||
}
|
||||
}, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue