Skip to content

Commit

Permalink
fix: MDX table transform
Browse files Browse the repository at this point in the history
  • Loading branch information
areknawo committed May 9, 2024
1 parent e0ddad1 commit 54edbba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/backend/extensions/src/routes/mdx/output-transformer.ts
Expand Up @@ -157,14 +157,14 @@ const mdxAsyncOutputTransformer = async (
);

if (elementWalker.children.length > 0) {
return `${openingTag}\n${(
return `${openingTag}\n${elementWalker.children.length > 1 ? "\n" : ""}${(
await transformContentNode(
elementWalker as JSONContentNodeWalker<JSONContentNode["element"]>
)
)
.split("\n")
.map((line) => ` ${line}`)
.join("\n")}\n</${attrs.type}>`;
.join("\n")}${elementWalker.children.length > 1 ? "\n" : ""}\n</${attrs.type}>`;
}

return openingTag;
Expand Down

0 comments on commit 54edbba

Please sign in to comment.