mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 21:46:13 +02:00
Fix small bug related to starring an entry with a date
If a date was given with an entry, and the star was also was added, the star wouldn't be recognized if it was at the start of the title. Example that didn't work, but now works with this fix: jrnl "saturday: *Title words." This is to be consistent in starring functionality with and without a date in the entry.
This commit is contained in:
parent
a54ed90259
commit
bfd1cf5eb8
3 changed files with 7 additions and 2 deletions
|
@ -279,7 +279,12 @@ class Journal:
|
|||
if date: # Parsed successfully, strip that from the raw text
|
||||
starred = raw[:colon_pos].strip().endswith("*")
|
||||
raw = raw[colon_pos + 1 :].strip()
|
||||
starred = starred or first_line.startswith("*") or first_line.endswith("*")
|
||||
starred = (
|
||||
starred
|
||||
or first_line.startswith("*")
|
||||
or first_line.endswith("*")
|
||||
or raw.startswith("*")
|
||||
)
|
||||
if not date: # Still nothing? Meh, just live in the moment.
|
||||
date = time.parse("now")
|
||||
entry = Entry.Entry(self, date, raw, starred=starred)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue