File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -514,8 +514,8 @@ ppNote clp todo = \case
514
514
-- | Parse the given string into a 'Note'.
515
515
pInput :: String -> Maybe Note
516
516
pInput inp = (`runParser` inp) . choice $
517
- [ Scheduled <$> getLast " +s" <*> (Time <$> pDate <*> pOrgTime) <*> pPriority
518
- , Deadline <$> getLast " +d" <*> (Time <$> pDate <*> pOrgTime) <*> pPriority
517
+ [ Scheduled <$> ( getLast " +s" <* " " ) <*> (Time <$> pDate <*> pOrgTime) <*> pPriority
518
+ , Deadline <$> ( getLast " +d" <* " " ) <*> (Time <$> pDate <*> pOrgTime) <*> pPriority
519
519
, do s <- munch1 (pure True )
520
520
let (s', p) = splitAt (length s - 3 ) s
521
521
pure $ case tryPrio p of
Original file line number Diff line number Diff line change @@ -61,6 +61,13 @@ spec = do
61
61
`shouldBe` Just (Scheduled " todo" (Time {date = Today , tod = Just $ MomentInTime (HHMM 12 0 )}) NoPriority )
62
62
pInput " todo +d 14:05 #B"
63
63
`shouldBe` Just (Deadline " todo" (Time {date = Today , tod = Just $ MomentInTime (HHMM 14 5 )}) B )
64
+ it " parses `blah+d` and `blah +d` as normal messages, but `blah +d ` as a deadline for today" $ do
65
+ pInput " blah+d"
66
+ `shouldBe` Just (NormalMsg " blah+d" NoPriority )
67
+ pInput " blah +d"
68
+ `shouldBe` Just (NormalMsg " blah +d" NoPriority )
69
+ pInput " blah +d "
70
+ `shouldBe` Just (Deadline " blah" (Time {date = Today , tod = Nothing }) NoPriority )
64
71
65
72
context " no priority#b" $ do
66
73
it " parses to the correct thing" $
You can’t perform that action at this time.
0 commit comments