This library allows you to convert an HTML string into Notion blocks that you can directly use for the Notion API
yarn add html-to-notion
import parseHtmlToNotionBlocks from '../src/lib/parser';
const rawHtml = `<p>Hi!</p>`;
const notionBlocks = parseHtmlToNotionBlocks(rawHtml);
// [
// {
// object: "block",
// paragraph: {
// text: [{ text: { content: "Hi" }, type: "text" }],
// },
// type: "paragraph",
// },
//];
- Support lists
- Support decorated texts