Skip to content

Commit

Permalink
Fix null scalar formatting (markdoc#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown authored Feb 1, 2023
1 parent f2fb25c commit 4422447
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/formatter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Markdoc is a **Markdown**-based \`syntax\` and _toolchain_ for creating ~~custom
[Link](/href "title")
![Alt](/image "title")
{% callout #id .class .class2 a="check" b={"e":{"with space": 5}} c=8 d=[1, "2",true] %}
{% callout #id .class .class2 a="check" b={"e":{"with space": 5}} c=8 d=[1, "2",true, null] %}
Markdoc is open-source—check out it's [source](http://github.com/markdoc/markdoc) to see how it works.
{% /callout %}
Expand Down Expand Up @@ -61,7 +61,7 @@ Markdoc is a **Markdown**-based \`syntax\` and _toolchain_ for creating ~~custom
a="check"
b={e: {"with space": 5}}
c=8
d=[1, "2", true] %}
d=[1, "2", true, null] %}
Markdoc is open-source—check out it's [source](http://github.com/markdoc/markdoc) to see how it works.
{% /callout %}
Expand Down
2 changes: 1 addition & 1 deletion src/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function formatScalar(v: Value): string {
return format(v);
}
if (v === null) {
return '';
return 'null';
}
if (Array.isArray(v)) {
return '[' + v.map(formatScalar).join(SEP) + ']';
Expand Down

0 comments on commit 4422447

Please sign in to comment.