-
Notifications
You must be signed in to change notification settings - Fork 47
feat: add support for table block rendering in Notion HTML conversion #239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for table block rendering in Notion HTML conversion #239
Conversation
|
The same problem of bulleted and numbered nested content being lost can be solved by fetch block children. If I come back from vacation next week and no one has dealt with it yet, I'll raise another PR. ⛱ |
|
@RayJason one of the problems with importing nested content is that it requires a separate API call to get the children of each block. So if there's 10 nested blocks on a page, it becomes 11 API calls instead of 1 which is very slow. Supporting nested blocks is definitely a great idea, but we will need to figure out if there's a way to make it faster so syncing doesn't take forever. This tables update is great - we can merge this before having support for nested blocks. |
ef27a1b to
66dfc0f
Compare
🤝 That's why I haven't submitted PRs for nested lists yet. For table, I'm slightly okay with only querying one level. But for a multi-level list, this will be a huge synchronous request calculation. I rebased the latest upstream/main branch. I also think we can merge table support first. Then work on optimizing for multi-level nested scenarios ✌️ |
|
Ok thanks! It will require another rebase after #221 is merged, but I think the changes will be very minimal because the parts of the code this PR touches don't have many changes in the new version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for rendering table blocks during Notion HTML conversion by retrieving table row children and updating the HTML generation logic.
- Adds a helper function getBlockChildrenIterator to retrieve table row children in plugins/notion/src/notion.ts.
- Updates blocksToHtml in plugins/notion/src/blocksToHTML.ts to include new cases for "table" and "table_row" blocks.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| plugins/notion/src/notion.ts | Added function to fetch children and updated block processing logic. |
| plugins/notion/src/blocksToHTML.ts | Introduced HTML rendering cases for table and table_row blocks. |
a5dd425 to
2726073
Compare
Description
Add support for table block rendering in Notion HTML conversion.
There is a confusing point: I can edit table in Framer CMS locked content 😂
Testing
Notion:
blocksToHtml
htmlContentresult:Framer CMS: