mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-05 12:19:58 +08:00
cell data: make sure that the cell id (from nbformat 4.5) is kept when saving notebooks
This commit is contained in:
parent
16727777f5
commit
b070efc32c
@ -490,6 +490,9 @@ define([
|
|||||||
var data = {};
|
var data = {};
|
||||||
// deepcopy the metadata so copied cells don't share the same object
|
// deepcopy the metadata so copied cells don't share the same object
|
||||||
data.metadata = JSON.parse(JSON.stringify(this.metadata));
|
data.metadata = JSON.parse(JSON.stringify(this.metadata));
|
||||||
|
if (this.id !== undefined) {
|
||||||
|
data.id = this.id;
|
||||||
|
}
|
||||||
if (data.metadata.deletable) {
|
if (data.metadata.deletable) {
|
||||||
delete data.metadata.deletable;
|
delete data.metadata.deletable;
|
||||||
}
|
}
|
||||||
@ -511,6 +514,9 @@ define([
|
|||||||
if (data.metadata !== undefined) {
|
if (data.metadata !== undefined) {
|
||||||
this.metadata = data.metadata;
|
this.metadata = data.metadata;
|
||||||
}
|
}
|
||||||
|
if (data.id !== undefined) {
|
||||||
|
this.id = data.id;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user