fix: copy text
This commit is contained in:
parent
e08bb40811
commit
adcb8478fa
|
|
@ -58,7 +58,7 @@
|
|||
"unist-util-visit": "^5.0.0",
|
||||
"unist-util-visit-parents": "^6.0.1",
|
||||
"yamljs": "^0.3.0",
|
||||
"zotero-plugin-toolkit": "^2.3.28"
|
||||
"zotero-plugin-toolkit": "^2.3.29"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ async function getMenuData(editor: Zotero.EditorInstance) {
|
|||
lineIndex: currentLine,
|
||||
}) || "";
|
||||
new ztoolkit.Clipboard()
|
||||
.addText(link, "text/unicode")
|
||||
.addText(link, "text/plain")
|
||||
.addText(
|
||||
`<a href="${link}">${
|
||||
e.editor._item.getNoteTitle().trim() || link
|
||||
|
|
@ -159,7 +159,7 @@ async function getMenuData(editor: Zotero.EditorInstance) {
|
|||
sectionName: currentSection,
|
||||
}) || "";
|
||||
new ztoolkit.Clipboard()
|
||||
.addText(link, "text/unicode")
|
||||
.addText(link, "text/plain")
|
||||
.addText(
|
||||
`<a href="${link}#${currentSection}">${
|
||||
e.editor._item.getNoteTitle().trim() || link
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ function removeTemplate(
|
|||
}
|
||||
|
||||
function importTemplateFromClipboard() {
|
||||
const templateText = Zotero.Utilities.Internal.getClipboard("text/unicode");
|
||||
const templateText = Zotero.Utilities.Internal.getClipboard("text/plain");
|
||||
if (!templateText) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -324,7 +324,7 @@ ${content
|
|||
.map((line) => ` ${line}`)
|
||||
.join("\n")}
|
||||
`;
|
||||
new ztoolkit.Clipboard().addText(yaml, "text/unicode").copy();
|
||||
new ztoolkit.Clipboard().addText(yaml, "text/plain").copy();
|
||||
showHint(
|
||||
`Template ${name} is copied to clipboard. To import it, goto Zotero menu bar, click Edit->New Template from Clipboard. `,
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue