-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
I had a typo in my org-file: <2024-11-12 14:00-17-00>
Yet orgparse parses it without complaining:
>>> orgparse.date.OrgDate.list_from_str("<2024-11-12 14:00-17-00>")
[OrgDate((2024, 11, 12, 14, 0, 0))]
With the typo fixed, the parsing get it right:
>>> orgparse.date.OrgDate.list_from_str("<2024-11-12 14:00-17:00>")
[OrgDate((2024, 11, 12, 14, 0, 0), (2024, 11, 12, 17, 0, 0))]
I would prefer an exception from invalid dates.
I may not fully know the org syntax for dates and maybe <2024-11-12 14:00-17-00> is kind-of-valid, like it could be a timezone offset of -00, haha, I hope no, I have not found it in the org manual yet.
Maybe a way to do it would be to restrict a bit the ignore regex like this:
- if brtype == 'nobrace':
- ignore = r'[\s\w]'
- else:
- ignore = '[^{bc}]'.format(bc=bc)
+ ignore = r'[\s\w]'but looking at the full regex it feels like the ignore part is used too much :D
Metadata
Metadata
Assignees
Labels
No labels