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
5
5
6
6
let url { Entry. id; kind; doc = _ } =
7
7
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
9
21
match Odoc_document.Url. from_identifier ~stop_before id with
10
22
| Ok url ->
11
23
let config =
You can’t perform that action at this time.
0 commit comments