diff --git a/src/render.test.ts b/src/render.test.ts index f857e5b..521e979 100644 --- a/src/render.test.ts +++ b/src/render.test.ts @@ -14,3 +14,10 @@ test('should allow `` attributes override', () => { expect(createRenderFunction()({title: 'Foobar'})).toMatch(''); expect(createRenderFunction([dirPlugin()])({title: 'Foobar'})).toMatch(''); }); + +test('should render root content', () => { + expect(createRenderFunction()({title: 'Foobar'})).toMatch(/
\s*<\/div>/); + expect(createRenderFunction()({title: 'Foobar', bodyContent: {root: 'content'}})).toMatch( + /
\s*content\s*<\/div>/, + ); +}); diff --git a/src/render.ts b/src/render.ts index 4e67ee1..e0ce8ca 100644 --- a/src/render.ts +++ b/src/render.ts @@ -86,7 +86,7 @@ export function createRenderFunction(plugins?: Plugins ${bodyContent.beforeRoot.join('\n')}
- ${bodyContent.root} + ${bodyContent.root ?? ''}
${bodyContent.afterRoot.join('\n')}