Skip to content

Commit

Permalink
4.02 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jonludlam committed Jun 21, 2023
1 parent 71fbcdc commit 50c676e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/document/generator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ let path_to_id path =
| Ok url -> Some url

let source_anchor locs =
(* Remove when dropping support for OCaml < 4.08 *)
let to_option = function Result.Ok x -> Some x | Result.Error _ -> None in
match locs with
| Some id ->
Url.Anchor.from_identifier
(id : Paths.Identifier.SourceLocation.t :> Paths.Identifier.t)
|> Result.to_option
|> to_option
| _ -> None

let attach_expansion ?(status = `Default) (eq, o, e) page text =
Expand Down

0 comments on commit 50c676e

Please sign in to comment.