diff --git a/lib/block.ts b/lib/block.ts index 6d3aa2e..82ecbe1 100644 --- a/lib/block.ts +++ b/lib/block.ts @@ -5,6 +5,7 @@ import type { } from './types'; import type { VNode } from 'vue'; +import { h } from 'vue'; import { Text } from './text'; import { name } from '../package.json'; @@ -72,6 +73,16 @@ export const Block = ({ content, componentsContext }: BlockProps) => { return BlockComponent(props); } + // Handle empty paragraphs separately as they should render a
tag + if ( + type === 'paragraph' && + childrenNodes.length === 1 && + childrenNodes[0].type === 'text' && + childrenNodes[0].text === '' + ) { + return h('br'); + } + const augmentedProps = augmentProps(content); const theChildren: any = childrenNodes.map((childNode) => {