@theseus.run/jsx-md 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/render.ts +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theseus.run/jsx-md",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "JSX/TSX renderer for Markdown. Write agent prompts and LLM instructions as typed, composable components. Zero runtime dependencies.",
5
5
  "type": "module",
6
6
  "author": "Roman Dubinin <romanonthego@gmail.com> (https://romanonthego.com)",
package/src/render.ts CHANGED
@@ -50,8 +50,9 @@ export function render(node: VNode): string {
50
50
  return `<${el.type}${attrStr}>\n${inner.trimEnd()}\n</${el.type}>\n`;
51
51
  }
52
52
 
53
- // Function component — call with its props (children still as VNode)
54
- return el.type(el.props);
53
+ // Function component — call with its props (children still as VNode),
54
+ // then recurse in case the component returned a VNode (e.g. a Fragment).
55
+ return render(el.type(el.props));
55
56
  }
56
57
 
57
58
  // Register render with Fragment immediately on module init.