Skip to content

Commit 1f6c0b9

Browse files
committed
restore key: null behavior
1 parent edc8080 commit 1f6c0b9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/core/jupyter/jupyter.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ import {
175175
jupyterCellSrcAsStr,
176176
} from "./jupyter-shared.ts";
177177
import { error } from "../../deno_ral/log.ts";
178+
import { valid } from "semver/mod.ts";
178179

179180
export const kQuartoMimeType = "quarto_mimetype";
180181
export const kQuartoOutputOrder = "quarto_order";
@@ -922,12 +923,14 @@ export function jupyterCellWithOptions(
922923
}
923924
};
924925

925-
const validMetadata: Record<string, string | number | boolean> = {};
926+
const validMetadata: Record<string, string | number | boolean | null> = {};
926927
for (const key of Object.keys(cell.metadata)) {
927928
const value = cell.metadata[key];
928929
let jsonEncodedKeyIndex = 0;
929930
if (value !== undefined) {
930-
if (value && typeof value === "object") {
931+
if (!value && typeof value === "object") {
932+
validMetadata[key] = null;
933+
} else if (value && typeof value === "object") {
931934
// https://github.com/quarto-dev/quarto-cli/issues/9089
932935
// we need to json-encode this and signal the encoding in the key
933936
// we can't use the key as is since it may contain invalid characters

0 commit comments

Comments
 (0)