@markdoc/markdoc 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -3
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +4 -3
- package/dist/index.mjs.map +2 -2
- package/dist/src/formatter.d.ts.map +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/formatter.test.ts +31 -3
- package/src/formatter.ts +7 -3
- package/src/types.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -6968,7 +6968,7 @@ function formatScalar(v) {
|
|
|
6968
6968
|
return "[" + v.map(formatScalar).join(SEP) + "]";
|
|
6969
6969
|
}
|
|
6970
6970
|
if (typeof v === "object") {
|
|
6971
|
-
return "{" + Object.entries(v).map(([key, value]) => `${key}: ${formatScalar(value)}`).join(SEP) + "}";
|
|
6971
|
+
return "{" + Object.entries(v).map(([key, value]) => `${isIdentifier(key) ? key : `"${key}"`}: ${formatScalar(value)}`).join(SEP) + "}";
|
|
6972
6972
|
}
|
|
6973
6973
|
return JSON.stringify(v);
|
|
6974
6974
|
}
|
|
@@ -7242,10 +7242,11 @@ function* formatNode(n, o = {}) {
|
|
|
7242
7242
|
yield* formatChildren(n, no);
|
|
7243
7243
|
break;
|
|
7244
7244
|
}
|
|
7245
|
-
case "
|
|
7246
|
-
|
|
7245
|
+
case "comment": {
|
|
7246
|
+
yield "<!-- " + n.attributes.content + " -->\n";
|
|
7247
7247
|
break;
|
|
7248
7248
|
}
|
|
7249
|
+
case "error":
|
|
7249
7250
|
case "node":
|
|
7250
7251
|
break;
|
|
7251
7252
|
}
|