summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@rak.ac>2020-06-07 20:28:40 -0400
committerRyan Kavanagh <rak@rak.ac>2020-06-07 20:28:40 -0400
commit14cee72509b86ef68e7d954a1f4243323c9e0809 (patch)
tree74340ea763942ff3b4e277b3110caf1bd901bc2d
parentAdd support for quoted lines (diff)
Update new prefix for list items
-rw-r--r--gemini/mimeTextGemini.ml6
1 files changed, 4 insertions, 2 deletions
diff --git a/gemini/mimeTextGemini.ml b/gemini/mimeTextGemini.ml
index ca4cd32..95f432b 100644
--- a/gemini/mimeTextGemini.ml
+++ b/gemini/mimeTextGemini.ml
@@ -136,7 +136,6 @@ struct
let take_line = lift (fun s -> Text s) take_till_cr in
peek_char >>= function
| Some '#' -> fail "text line cannot start with #"
- | Some '*' -> fail "text line cannot start with *"
| Some '>' -> fail "text line cannot start with >"
| Some '`' -> (peek_string 3 >>= function
| "```" -> fail "text line cannot start with ```"
@@ -144,6 +143,9 @@ struct
| Some '=' -> (peek_char >>= function
| Some '>' -> fail "text line cannot start with =>"
| _ -> take_line)
+ | Some '*' -> (peek_char >>= function
+ | Some ' ' -> fail "text line cannot start with `* '"
+ | _ -> take_line)
| _ -> take_line
let str_to_text_line = parse_string text_parser
@@ -164,7 +166,7 @@ struct
let str_to_pre_block = parse_string pre_block_parser
let list_item_parser =
- lift (fun x -> Ul x) (string "*" *> skip_spaces *> take_till_cr)
+ lift (fun x -> Ul x) (string "* " *> skip_spaces *> take_till_cr)
let str_to_list_line = parse_string list_item_parser