Skip to content

Commit c742fac

Browse files
committed
Use 1 based index to index cells
1 parent a2a020e commit c742fac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/jupyter/jupyter-embed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,12 @@ async function notebookMarkdown(
256256
} else if (nbAddress.indexes) {
257257
// Filter and sort based upon cell indexes
258258
const theCells = nbAddress.indexes.map((idx) => {
259-
if (idx < 0 || idx >= notebookInfo.outputs.length) {
259+
if (idx < 1 || idx >= notebookInfo.outputs.length) {
260260
throw new Error(
261261
`The cell index ${idx} isn't within the range of cells`,
262262
);
263263
}
264-
return notebookInfo.outputs[idx];
264+
return notebookInfo.outputs[idx - 1];
265265
});
266266
return notebookMarkdown(theCells, notebookInfo.title);
267267
} else {

0 commit comments

Comments
 (0)