fix: zotero 7 template preview bug
This commit is contained in:
parent
fb77d7e126
commit
dd57ef066e
|
|
@ -184,10 +184,14 @@ async function updatePreview() {
|
|||
const win = addon.data.templateEditor.window;
|
||||
const container = win?.document.getElementById("preview-container");
|
||||
if (container) {
|
||||
container.innerHTML = "";
|
||||
container.appendChild(
|
||||
ztoolkit.getDOMParser().parseFromString(html, "text/html").body
|
||||
);
|
||||
if (ztoolkit.isZotero7()) {
|
||||
container.innerHTML = html;
|
||||
} else {
|
||||
container.innerHTML = "";
|
||||
container.appendChild(
|
||||
ztoolkit.getDOMParser().parseFromString(html, "text/html").body
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ async function renderTemplatePreview(
|
|||
inputItems?: Zotero.Item[]
|
||||
): Promise<string> {
|
||||
let html: string = "<p>Preview rendering failed</p>";
|
||||
if (inputItems) {
|
||||
if (!inputItems) {
|
||||
inputItems = ZoteroPane.getSelectedItems();
|
||||
}
|
||||
if (templateName.startsWith("[Text]")) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue