mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-05 20:30:15 +01:00
This commit is contained in:
parent
029aa47283
commit
fa6f57dc97
3 changed files with 62 additions and 0 deletions
|
|
@ -485,6 +485,29 @@ export class Gutter {
|
|||
}
|
||||
}
|
||||
}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.copyPlainText,
|
||||
click() {
|
||||
let html = "";
|
||||
selectsElement.forEach(item => {
|
||||
const editElement = getContenteditableElement(item);
|
||||
if (editElement) {
|
||||
html += editElement.textContent + "\n";
|
||||
}
|
||||
});
|
||||
writeText(html.trimEnd());
|
||||
}
|
||||
}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.copy + " HTML",
|
||||
click() {
|
||||
let html = "";
|
||||
selectsElement.forEach(item => {
|
||||
html += item.outerHTML
|
||||
});
|
||||
writeText(protyle.lute.BlockDOM2HTML(html));
|
||||
}
|
||||
}).element);
|
||||
if (window.siyuan.config.readonly) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -826,6 +849,19 @@ export class Gutter {
|
|||
document.execCommand("copy");
|
||||
}
|
||||
}
|
||||
}, {
|
||||
label: window.siyuan.languages.copyPlainText,
|
||||
click() {
|
||||
const editElement = getContenteditableElement(nodeElement);
|
||||
if (editElement) {
|
||||
writeText(editElement.textContent);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
label: window.siyuan.languages.copy + " HTML",
|
||||
click() {
|
||||
writeText(protyle.lute.BlockDOM2HTML(nodeElement.outerHTML));
|
||||
}
|
||||
}, {
|
||||
label: window.siyuan.languages.duplicate,
|
||||
disabled: window.siyuan.config.readonly,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue