Skip to content

Commit e2efe36

Browse files
committed
fix: Data block detail may double-yaml-stringify
This also updates Code to use line wrapping. Signed-off-by: Nick Mitchell <[email protected]>
1 parent 465c28a commit e2efe36

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pdl-live-react/src/view/Result.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function Result({
2727
const isCode = !!lang && lang !== "plaintext" && !!result
2828

2929
const innerContent = isCode ? (
30-
<Code block={result} language={lang} wrap={false} />
30+
<Code block={result} language={lang} />
3131
) : (
3232
<Value>{result}</Value>
3333
)

pdl-live-react/src/view/detail/kind/Data.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ export default function ModelItems({
77
block: import("../../../pdl_ast").DataBlock
88
}) {
99
return (
10-
<Result result={stringify(result)} lang="yaml" term={def ?? "Struct"} />
10+
<Result
11+
result={typeof result === "string" ? result.trim() : stringify(result)}
12+
lang={typeof result === "string" ? undefined : "yaml"}
13+
term={def ?? "Struct"}
14+
/>
1115
)
1216
}

0 commit comments

Comments
 (0)