Change exportNotebook API to return string

This commit is contained in:
Rob Lourens
2021-08-05 17:14:37 -07:00
parent bc0e917553
commit 1dae051c56
2 changed files with 5 additions and 5 deletions

View File

@@ -74,10 +74,10 @@ export class NotebookSerializer implements vscode.NotebookSerializer {
}
public serializeNotebook(data: vscode.NotebookData, _token: vscode.CancellationToken): Uint8Array {
return new TextEncoder().encode(this.serialize(data));
return new TextEncoder().encode(this.serializeNotebookToString(data));
}
private serialize(data: vscode.NotebookData): string {
public serializeNotebookToString(data: vscode.NotebookData): string {
const notebookContent: Partial<nbformat.INotebookContent> = data.metadata?.custom || {};
notebookContent.cells = notebookContent.cells || [];
notebookContent.nbformat = notebookContent.nbformat || 4;