diff --git a/markdownrunner.py b/markdownrunner.py index 93ac0be..9a0d835 100755 --- a/markdownrunner.py +++ b/markdownrunner.py @@ -142,10 +142,11 @@ def user_action(hunk: Sequence[Command], context=None) -> Sequence[Command]: tmpfile.file.seek(0) new_hunk = [] for line in tmpfile.file.readlines(): - line = line.strip() if line == '': continue parts = line.split('\t', maxsplit=2) + # Change user to None if it is not specified + parts[0] = parts[0].strip() if parts[0].strip() != '' else None # Change directory to None if it is not specified parts[1] = parts[1].strip() if parts[1].strip() != '' else None new_hunk.append(Command(user=parts[0],directory=parts[1],command=parts[2],context=None))