fix: error when parsing figure tag without figcaption (#147)

This commit is contained in:
Igor Lobanov 2023-07-28 18:36:56 +02:00 committed by GitHub
parent 506b36af7f
commit 844f65dd9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,7 +67,8 @@ export const Figure = Node.create<FigureOptions>({
return [
{
tag: 'figure',
contentElement: 'figcaption'
contentElement: (dom: HTMLElement) =>
dom.querySelector('figcaption') ?? document.createElement('figcaption')
}
]
},