Skip to content

Commit 059b05a

Browse files
agoose77fwkoch
authored andcommitted
fix: outputs for JATS
1 parent 028f385 commit 059b05a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/myst-to-jats/src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -638,20 +638,20 @@ const handlers: Handlers = {
638638
},
639639
output(node, state) {
640640
if (state.data.isInContainer) {
641-
if (!node.data?.[0]) return;
642-
alternativesFromMinifiedOutput(node.data[0], state);
641+
if (!node.jupyter_data) return;
642+
alternativesFromMinifiedOutput(node.jupyter_data, state);
643643
return;
644644
}
645645
const { identifier } = node;
646646
const attrs: Attributes = { 'sec-type': 'notebook-output' };
647-
node.data?.forEach((output: any, index: number) => {
647+
if (node.jupyter_data) {
648648
state.openNode('sec', {
649649
...attrs,
650-
id: identifier && !state.data.isNotebookArticleRep ? `${identifier}-${index}` : undefined,
650+
id: identifier && !state.data.isNotebookArticleRep ? identifier : undefined,
651651
});
652-
alternativesFromMinifiedOutput(output, state);
652+
alternativesFromMinifiedOutput(node.jupyter_data, state);
653653
state.closeNode();
654-
});
654+
}
655655
},
656656
embed(node, state) {
657657
if (state.data.isInContainer) {

0 commit comments

Comments
 (0)