File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,10 @@ let escape_mrkdwn =
11
11
| '&' -> " &"
12
12
| c -> String. make 1 c)
13
13
14
- (* omd escapes parentheses in text (bug?) *)
15
14
let unescape_omd =
16
15
Staged. unstage @@ String.Escaping. unescape_gen_exn ~escapeworthy_map: [ '(' , '(' ; ')' , ')' ] ~escape_char: '\\'
17
16
18
- let transform_text s = escape_mrkdwn @@ unescape_omd s
17
+ let transform_text = escape_mrkdwn
19
18
20
19
let rec transform_list = List. map ~f: transform
21
20
@@ -48,4 +47,5 @@ and transform = function
48
47
| Text s -> Text (transform_text s)
49
48
| (Code _ | Br | Hr | NL | Ref _ | Img_ref _ | Raw _ | Raw_block _ | X _ ) as e -> e
50
49
51
- let mrkdwn_of_markdown str = to_markdown @@ transform_list @@ of_string str
50
+ (* unescaping here is a workaround of to_markdown escaping parentheses in text (bug?) *)
51
+ let mrkdwn_of_markdown str = unescape_omd @@ to_markdown @@ transform_list @@ of_string str
You can’t perform that action at this time.
0 commit comments