Skip to content

Notion API: Handle nested paragraphs#545

Open
danielgavrilov wants to merge 1 commit into
obsidianmd:masterfrom
danielgavrilov:notion-api-nested-paragraphs
Open

Notion API: Handle nested paragraphs#545
danielgavrilov wants to merge 1 commit into
obsidianmd:masterfrom
danielgavrilov:notion-api-nested-paragraphs

Conversation

@danielgavrilov
Copy link
Copy Markdown

@danielgavrilov danielgavrilov commented Apr 23, 2026

Nested paragraphs were silently discarded on import. A paragraph indented under another paragraph in Notion (Tab in the editor — the child arrives in the API as a block in the parent's .children with has_children: true) would simply vanish from the output.

Fix

convertParagraph now recursively converts its children and emits them below the parent, prefixing each nested level with 4 spaces per depth so the hierarchy is preserved in the Markdown.

Example

Screenshot 2026-04-23 at 12 00 36

Before: only "A paragraph with children" made it into the note — both nested paragraphs were dropped.

After: All paragraphs included.

They were getting completely discarded.
@danielgavrilov
Copy link
Copy Markdown
Author

One thing I'm not sure about: Markdown doesn't really support nesting paragraphs.

In Obsidian's Edit mode, the paragraphs appear indented, but not Reading mode (leading whitespace is ignored).

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.

1 participant