diff --git a/extensions/ipynb/src/serializers.ts b/extensions/ipynb/src/serializers.ts index 27c45bce918b8..ce43bbae3fc64 100644 --- a/extensions/ipynb/src/serializers.ts +++ b/extensions/ipynb/src/serializers.ts @@ -73,9 +73,9 @@ function createCodeCellFromNotebookCell(cell: NotebookCellData, preferredLanguag languageId: cell.languageId } }; - } else { + } else if (metadata.vscode) { // cell current language is the same as the preferred cell language in the document, flush the vscode custom language id metadata - metadata.vscode = undefined; + delete metadata.vscode; } const codeCell: any = {