mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-21 18:59:15 +00:00
Change exportNotebook API to return string
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user