Skip to content

feat: add support for toggles#72

Open
sroze wants to merge 5 commits intotryfabric:masterfrom
sroze:feat/add-support-for-the-toggle
Open

feat: add support for toggles#72
sroze wants to merge 5 commits intotryfabric:masterfrom
sroze:feat/add-support-for-the-toggle

Conversation

@sroze
Copy link

@sroze sroze commented Apr 12, 2025

This PR adds support for Markdown toggles to be converted into Notion blocks.

@sroze sroze changed the title feat: add support for the toggle feat: add support for toggles Apr 12, 2025
@sroze
Copy link
Author

sroze commented Apr 23, 2025

@marissamarym @EndBug keen to have your eyes on this one :)

Copy link
Member

@EndBug EndBug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for the PR!
I've just seen it: can you clarify a bit about the nesting?

}

export function paragraph(text: RichText[]): Block {
export function paragraph(text: RichText[]): BlockWithoutChildren {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?
Paragraphs allow for nested blocks don't they?


export function toggle(
text: RichText[],
children: BlockWithoutChildren[] = []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Toggles can nest indefinitely, children should just be an array of nomral blocks
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that the issue is that in gfm it's just html, and you can't nest that? Is that correct?

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.

2 participants

Comments