@blocknote/core
Version:
A "Notion-style" block-based extensible text editor built on top of Prosemirror and Tiptap.
14 lines (11 loc) • 345 B
text/typescript
export const createFigureWithCaption = (
element: HTMLElement,
caption: string,
) => {
const figure = document.createElement("figure");
const captionElement = document.createElement("figcaption");
captionElement.textContent = caption;
figure.appendChild(element);
figure.appendChild(captionElement);
return { dom: figure };
};