@@ -76,6 +76,13 @@ and inline_element_list_to_inlines inlines =
76
76
let inlines = List. map ~f: inline_element_to_inline inlines in
77
77
Inline. Inlines (inlines, Meta. none)
78
78
79
+ (* * Hack: Because of bug described here:
80
+ https://github.com/dbuenzli/cmarkit/issues/7 , we use only first block line.
81
+ It contains whole string, which seems good enough for our use cases. To be
82
+ removed when: https://github.com/dbuenzli/cmarkit/pull/8 gets merged and
83
+ released *)
84
+ let block_lines_of_string str = [ List. hd (Block_line. list_of_string str) ]
85
+
79
86
let rec nestable_block_element_to_block
80
87
(nestable :
81
88
Odoc_parser.Ast.nestable_block_element Odoc_parser.Loc.with_location ) =
@@ -133,18 +140,18 @@ let rec nestable_block_element_to_block
133
140
| Some ({ value = lang ; location = lang_log } , _env ) ->
134
141
Some (lang, loc_to_meta lang_log)
135
142
in
136
- let block_line = Block_line. list_of_string code in
143
+ let block_line = block_lines_of_string code in
137
144
let code_block = Block.Code_block. make ?info_string block_line in
138
145
let meta = loc_to_meta location in
139
146
Block. Code_block (code_block, meta)
140
147
| Odoc_parser.Loc. { value = `Verbatim code ; location } ->
141
148
let info_string = Some (" verb" , Meta. none) in
142
- let block_line = Block_line. list_of_string code in
149
+ let block_line = block_lines_of_string code in
143
150
let code_block = Block.Code_block. make ?info_string block_line in
144
151
let meta = loc_to_meta location in
145
152
Block. Code_block (code_block, meta)
146
153
| Odoc_parser.Loc. { value = `Math_block code ; location } ->
147
- let block_line = Block_line. list_of_string code in
154
+ let block_line = block_lines_of_string code in
148
155
let code_block = Block.Code_block. make block_line in
149
156
let meta = loc_to_meta location in
150
157
Block. Ext_math_block (code_block, meta)
0 commit comments