Skip to content

Commit

Permalink
fix(satori): transform inner components
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Oct 31, 2024
1 parent e0d1084 commit 45cef44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core/src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@ export class Session<C extends Context = Context> {
}

async transform(elements: h[]): Promise<h[]> {
return await h.transformAsync(elements, ({ type, attrs, children }, session) => {
return await h.transformAsync(elements, async ({ type, attrs, children }, session) => {
const render = type === 'component' ? attrs.is : this.app.get('component:' + type)
return render?.(attrs, children, session) ?? true
if (!render) return true
return render(attrs, await this.transform(children), session)
}, this)
}

Expand Down

0 comments on commit 45cef44

Please sign in to comment.