Skip to content

Commit 53d3703

Browse files
authored
Update cmarkit and remove hack (#6)
1 parent 67a2e2a commit 53d3703

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

dune-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ possible and does not make any assumptions about IO.
5656
ordering
5757
dune-build-info
5858
spawn
59-
(cmarkit (= 0.1.0))
59+
(cmarkit (>= 0.2.0))
6060
(odoc-parser (>= 2.0.0))
6161
(ppx_expect (and (>= v0.15.0) :with-test))
6262
(ocamlformat (and :with-test (= 0.24.1)))

ocaml-lsp-server.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ depends: [
3232
"ordering"
3333
"dune-build-info"
3434
"spawn"
35-
"cmarkit" {= "0.1.0"}
35+
"cmarkit" {>= "0.2.0"}
3636
"odoc-parser" {>= "2.0.0"}
3737
"ppx_expect" {>= "v0.15.0" & with-test}
3838
"ocamlformat" {with-test & = "0.24.1"}

ocaml-lsp-server/src/doc_to_md.ml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,6 @@ and inline_element_list_to_inlines inlines =
7676
let inlines = List.map ~f:inline_element_to_inline inlines in
7777
Inline.Inlines (inlines, Meta.none)
7878

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-
8679
let rec nestable_block_element_to_block
8780
(nestable :
8881
Odoc_parser.Ast.nestable_block_element Odoc_parser.Loc.with_location) =
@@ -140,18 +133,18 @@ let rec nestable_block_element_to_block
140133
| Some ({ value = lang; location = lang_log }, _env) ->
141134
Some (lang, loc_to_meta lang_log)
142135
in
143-
let block_line = block_lines_of_string code in
136+
let block_line = Block_line.list_of_string code in
144137
let code_block = Block.Code_block.make ?info_string block_line in
145138
let meta = loc_to_meta location in
146139
Block.Code_block (code_block, meta)
147140
| Odoc_parser.Loc.{ value = `Verbatim code; location } ->
148141
let info_string = Some ("verb", Meta.none) in
149-
let block_line = block_lines_of_string code in
142+
let block_line = Block_line.list_of_string code in
150143
let code_block = Block.Code_block.make ?info_string block_line in
151144
let meta = loc_to_meta location in
152145
Block.Code_block (code_block, meta)
153146
| Odoc_parser.Loc.{ value = `Math_block code; location } ->
154-
let block_line = block_lines_of_string code in
147+
let block_line = Block_line.list_of_string code in
155148
let code_block = Block.Code_block.make block_line in
156149
let meta = loc_to_meta location in
157150
Block.Ext_math_block (code_block, meta)

0 commit comments

Comments
 (0)