File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -25,13 +25,20 @@ let rec mrkdwn_of_md md =
25
25
Buffer. add_char b ' '
26
26
done
27
27
in
28
- let rec f ?(fst_p_in_li = true ) ?(is_in_list = false ) list_indent tl = function
28
+ let rec loop ?(fst_p_in_li = true ) ?(is_in_list = false ) list_indent =
29
29
(* [list_indent: int] is the indentation level in number of spaces.
30
30
[fst_p_in_li: bool] is used to apply different indentation to the first
31
31
paragraph in a list items.
32
32
[is_in_list: bool] is necessary to know if we are inside a paragraph
33
33
which is inside a list item because those need to be indented!
34
34
*)
35
+ let loop ?(fst_p_in_li = fst_p_in_li) ?(is_in_list = is_in_list) list_indent l =
36
+ loop ~fst_p_in_li ~is_in_list list_indent l
37
+ in
38
+ function
39
+ | [] -> ()
40
+ | el :: tl ->
41
+ match el with
35
42
| X _ -> loop list_indent tl
36
43
| Blockquote q ->
37
44
(* mrkdwn doesn't support nested quotes, but output '>' chars anyway*)
@@ -179,9 +186,6 @@ let rec mrkdwn_of_md md =
179
186
(* the string "\n" renders NL *)
180
187
nl_if_needed_above b;
181
188
loop list_indent tl
182
- and loop ?(fst_p_in_li = true ) ?(is_in_list = false ) list_indent = function
183
- | hd :: tl -> f ~fst_p_in_li ~is_in_list list_indent tl hd
184
- | [] -> ()
185
189
in
186
190
(* print the document *)
187
191
loop 0 md;
You can’t perform that action at this time.
0 commit comments