Skip to content

Commit f3cc281

Browse files
tjenkinsongitbutler-client
authored andcommitted
Handle quote having no rendered children
We have a block like ```json { "type": "quote", "blockId": “<snip>", "parent": "> <u>Table of Contents</u>", "children": [ { "type": "table_of_contents", "blockId": "<snip>", "parent": "", "children": [] } ] } ``` where `mdstr` ends up being `{}`, which without this causes a crash
1 parent c751310 commit f3cc281

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/notion-to-md.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class NotionToMarkdown {
142142
nestingLevel,
143143
);
144144

145-
const formattedContent = (mdstr.parent ?? mdstr[pageIdentifier])
145+
const formattedContent = (mdstr.parent ?? mdstr[pageIdentifier] ?? '')
146146
.split("\n")
147147
.map((line) => (line.trim() ? `> ${line}` : ">"))
148148
.join("\n")

0 commit comments

Comments
 (0)