This commit is contained in:
Vanessa 2022-08-22 22:58:39 +08:00
parent ff1dea9658
commit b3150e2ce7

View file

@ -255,15 +255,15 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => {
label: window.siyuan.languages.copyPlainText,
click() {
focusByRange(getEditorRange(nodeElement));
writeText(range.toString());
writeText(getSelection().getRangeAt(0).toString());
}
}).element);
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.copy +" HTML",
label: window.siyuan.languages.copy + " HTML",
click() {
focusByRange(getEditorRange(nodeElement));
let html = "";
range.cloneContents().childNodes.forEach(item => {
getSelection().getRangeAt(0).cloneContents().childNodes.forEach(item => {
if (item.nodeType === 3) {
html += item.textContent;
} else {