Skip to content

Commit ca5c768

Browse files
committed
handle text / blocks in lists better
this allows including more than just text in list items and them not blowing up in the process
1 parent 7c4a793 commit ca5c768

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Diff for: notion_docs_sync/markdown.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,17 @@ def render_list_item(self, token):
244244

245245
children = self.__render_multiple(token.children)
246246

247+
title = []
248+
249+
if len(children) > 0:
250+
if children[0]['type'] == TextBlock:
251+
title = only_notion_text(children[0:1])
252+
children = children[1:]
253+
247254
return {
248255
'type': block_type,
249-
'title': only_notion_text(children),
250-
'children': without_notion_text(children),
256+
'title': title,
257+
'children': children
251258
}
252259

253260
def render_table(self, token):

0 commit comments

Comments
 (0)