From b070efc32ccce04c98549a80bc0209572a4f1bfb Mon Sep 17 00:00:00 2001 From: mishaschwartz Date: Wed, 6 Jan 2021 10:03:26 -0500 Subject: [PATCH] cell data: make sure that the cell id (from nbformat 4.5) is kept when saving notebooks --- notebook/static/notebook/js/cell.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/notebook/static/notebook/js/cell.js b/notebook/static/notebook/js/cell.js index 023b3d375..dbe031359 100644 --- a/notebook/static/notebook/js/cell.js +++ b/notebook/static/notebook/js/cell.js @@ -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; + } };