Reference to label in preamble are broken
(** {1:L1 Some label} *)
module M : sig
type t
(** Ref 1: {!L1} *)
end
(** Ref 2: {!L1} *)
(** Ref 3: {!M.L1} *)
In this example, refs 1 and 2 resolve to Test/index.html#L1 and ref 3 doesn't.
The heading labeled L1 is part of the preamble of M but not its synopsis. It is rendered into the page for M but not in the top-level page (where the anchor L1 doesn't exist).
The expected behavior is: refs 1 and 3 resolve to Test/M/index.html#L1 and ref 2 does not.
The behavior I suggested above means resolving differently the first paragraph from the rest of the comment. The first paragraph is the synopsis and would be handled in the context of the top-level module and the rest of the comment (including the heading) would be handled in the context of M.
This is inconsistent with what was decided in https://github.com/ocaml/odoc/pull/739.
A better solution is to disallow headings attached to items. I think this was already implemented at some point.
I don't think you are supposed to have sections in your preamble (I can't find again the long discussion we had when we established the preamble / section structure).