Skip to content

Commit

Permalink
fix: timestamp parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin committed Jan 18, 2022
1 parent 5ebe09e commit 84cd9a2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/syntax/outline_inline.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ open! Prelude
open Angstrom
open Parsers

let empty_plain = fun _ -> return (Inline.Plain "")

let inline_choices config : Inline.t_with_pos Angstrom.t =
let p =
peek_char_fail >>= function
Expand All @@ -16,9 +18,12 @@ let inline_choices config : Inline.t_with_pos Angstrom.t =
| 'c'
| 'd' ->
Inline.timestamp
| ' ' | '\t' | '\n' | '\r' | '\012' -> any_char >>= empty_plain
| _ ->
take_till1 (fun c -> c = '#' || c = '[' || c = '(') >>= fun _ ->
return (Inline.Plain "")
take_till1 (fun c ->
c = '#' || c = '[' || c = '('
)
>>= empty_plain
in
(fun t -> (t, None)) <$> p

Expand Down

0 comments on commit 84cd9a2

Please sign in to comment.