More robust
This commit is contained in:
parent
47761eb4d7
commit
188249e39f
|
@ -162,6 +162,7 @@ class ObsidianVault:
|
||||||
)
|
)
|
||||||
|
|
||||||
events = list(contents.events)
|
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.subject or '')
|
||||||
events.sort(key=lambda x: x.verb or '')
|
events.sort(key=lambda x: x.verb or '')
|
||||||
date_sentinel = datetime.datetime(1900, 1, 1, 1, 1, 1, tzinfo=contents.timezone)
|
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)
|
isinstance(block, marko.block.Heading)
|
||||||
and block.children[0].children.lower() == 'events'
|
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):
|
if isinstance(events_block, marko.block.List):
|
||||||
offset = 2
|
offset = 2
|
||||||
event_texts = [
|
event_texts = [
|
||||||
|
|
Loading…
Reference in New Issue
Block a user