cell data: make sure that the cell id (from nbformat 4.5) is kept when saving notebooks

This commit is contained in:
mishaschwartz 2021-01-06 10:03:26 -05:00
parent 16727777f5
commit b070efc32c

View File

@ -490,6 +490,9 @@ define([
var data = {};
// deepcopy the metadata so copied cells don't share the same object
data.metadata = JSON.parse(JSON.stringify(this.metadata));
if (this.id !== undefined) {
data.id = this.id;
}
if (data.metadata.deletable) {
delete data.metadata.deletable;
}
@ -511,6 +514,9 @@ define([
if (data.metadata !== undefined) {
this.metadata = data.metadata;
}
if (data.id !== undefined) {
this.id = data.id;
}
};