diff --git a/src/gtimelog/timelog.py b/src/gtimelog/timelog.py index 9a96cefa..85d2c3b4 100644 --- a/src/gtimelog/timelog.py +++ b/src/gtimelog/timelog.py @@ -249,9 +249,10 @@ def split_category(entry): Return a tuple (category, task). """ if ': ' in entry: - return tuple(entry.split(': ', 1)) + cat, tsk = entry.split(': ', 1) + return cat.strip(), tsk.strip() elif entry.endswith(':'): - return entry.partition(':')[0], '' + return entry.partition(':')[0].strip(), '' else: return None, entry