Skip to content

Conversation

@RayJason
Copy link
Contributor

@RayJason RayJason commented Jun 11, 2025

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 😂

image

Testing

Notion:

image

blocksToHtml htmlContent result:

<table><tr><td>Name</td><td>Age</td></tr><thead><tr><th>Tom</th><th>21</th></tr></thead><tbody><thead><tr><th>Jerry</th><th>22</th></tr></thead><tbody><thead><tr><th>Marry</th><th>18</th></tr></thead><tbody></tbody></table><p></p><p></p><p></p>

Framer CMS:

image
  • Description of test case one
    • Create a simple table in Notion Page
    • Sync the CMS
    • Check CMS Content

@RayJason
Copy link
Contributor Author

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 RayJason mentioned this pull request Jun 11, 2025
1 task
@RayJason RayJason marked this pull request as ready for review June 11, 2025 09:30
@madebyisaacr
Copy link
Collaborator

madebyisaacr commented Jun 18, 2025

@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.

@RayJason RayJason force-pushed the rayjason/feat/notion-plugin-support-table branch from ef27a1b to 66dfc0f Compare June 20, 2025 06:56
@RayJason
Copy link
Contributor Author

@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.

🤝 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 ✌️

@madebyisaacr
Copy link
Collaborator

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.

@triozer triozer requested a review from Copilot June 23, 2025 14:15
Copy link
Contributor

Copilot AI left a 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.

@triozer triozer force-pushed the rayjason/feat/notion-plugin-support-table branch from a5dd425 to 2726073 Compare June 25, 2025 09:07
@triozer triozer merged commit e41d5ad into framer:main Jun 25, 2025
3 of 4 checks passed
madebyisaacr added a commit to madebyisaacr/plugins that referenced this pull request Jun 26, 2025
madebyisaacr added a commit to madebyisaacr/plugins that referenced this pull request Jun 26, 2025
madebyisaacr added a commit to madebyisaacr/plugins that referenced this pull request Jul 1, 2025
madebyisaacr added a commit to madebyisaacr/plugins that referenced this pull request Jul 4, 2025
madebyisaacr added a commit to madebyisaacr/plugins that referenced this pull request Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants