Skip to content

Commit 8ba8f74

Browse files
committed
Don’t add duplicates when mergin notebooks
1 parent 911ab16 commit 8ba8f74

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/command/render/pandoc.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,16 @@ export async function runPandoc(
549549
? [documentNotebooks]
550550
: [];
551551

552+
// Only add notebooks that aren't already present
553+
const uniqExtraNotebooks = extras[kNotebooks].filter((nb) => {
554+
return !userNotebooks.find((userNb) => {
555+
return userNb.notebook === nb.notebook;
556+
});
557+
});
558+
552559
options.format.render[kNotebookView] = [
553-
...extras[kNotebooks],
554560
...userNotebooks,
561+
...uniqExtraNotebooks,
555562
];
556563
}
557564
}

0 commit comments

Comments
 (0)