Skip to content

Commit b070efc

Browse files
committed
cell data: make sure that the cell id (from nbformat 4.5) is kept when saving notebooks
1 parent 1672777 commit b070efc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

notebook/static/notebook/js/cell.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,9 @@ define([
490490
var data = {};
491491
// deepcopy the metadata so copied cells don't share the same object
492492
data.metadata = JSON.parse(JSON.stringify(this.metadata));
493+
if (this.id !== undefined) {
494+
data.id = this.id;
495+
}
493496
if (data.metadata.deletable) {
494497
delete data.metadata.deletable;
495498
}
@@ -511,6 +514,9 @@ define([
511514
if (data.metadata !== undefined) {
512515
this.metadata = data.metadata;
513516
}
517+
if (data.id !== undefined) {
518+
this.id = data.id;
519+
}
514520
};
515521

516522

0 commit comments

Comments
 (0)