diff --git a/obsidian_import/obsidian.py b/obsidian_import/obsidian.py index 79a8a4f..00b0e94 100644 --- a/obsidian_import/obsidian.py +++ b/obsidian_import/obsidian.py @@ -162,6 +162,7 @@ class ObsidianVault: ) events = list(contents.events) + events.sort(key=lambda x: x.comment or '') events.sort(key=lambda x: x.subject or '') events.sort(key=lambda x: x.verb or '') date_sentinel = datetime.datetime(1900, 1, 1, 1, 1, 1, tzinfo=contents.timezone) @@ -232,7 +233,7 @@ def find_events_list_block(ast) -> tuple[list, list[str], list]: isinstance(block, marko.block.Heading) and block.children[0].children.lower() == 'events' ): - events_block = ast.children[block_i + 1] + events_block = ast.children[block_i + 1] if block_i + 1 < len(ast.children) else None if isinstance(events_block, marko.block.List): offset = 2 event_texts = [