File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,19 @@ open Lang
55
66let url { Entry. id; kind; doc = _ } =
77 let open Entry in
8- let stop_before = match kind with Doc _ -> false | _ -> true in
8+ let stop_before =
9+ (* Some module/module types/... might not have an expansion, so we need to
10+ be careful and set [stop_before] to [true] for those kind of search
11+ entries, to avoid linking to an inexistant page.
12+
13+ Docstring do not have an ID in the model, and use the ID from the parent
14+ signature in search entries. Therefore, links to doc comments need
15+ [stop_before] to be [false] to point to the page where they are present.
16+
17+ Values, types, ... are not sensitive to [stop_before], allowing us to
18+ shorten the match. *)
19+ match kind with Doc _ -> false | _ -> true
20+ in
921 match Odoc_document.Url. from_identifier ~stop_before id with
1022 | Ok url ->
1123 let config =
You can’t perform that action at this time.
0 commit comments