Skip to content

Commit

Permalink
handle text / blocks in lists better
Browse files Browse the repository at this point in the history
this allows including more than just text in list items
and them not blowing up in the process
  • Loading branch information
imnotjames committed May 26, 2020
1 parent 7c4a793 commit ca5c768
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions notion_docs_sync/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,17 @@ def render_list_item(self, token):

children = self.__render_multiple(token.children)

title = []

if len(children) > 0:
if children[0]['type'] == TextBlock:
title = only_notion_text(children[0:1])
children = children[1:]

return {
'type': block_type,
'title': only_notion_text(children),
'children': without_notion_text(children),
'title': title,
'children': children
}

def render_table(self, token):
Expand Down

0 comments on commit ca5c768

Please sign in to comment.