Skip to content

Don't allow links to hidden pages #1370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 15, 2025

Conversation

jonludlam
Copy link
Member

A while back we changed the type of Path.Resolved.identifier so we could return None for the case where there is genuinely no identifier that can be used. This was initially for to allow paths to core types to be resolved, even though there's no destination for them.

This commit extends this idea so that attempting to generate an identifier for a hidden path will result in None. Whilst we would prefer not to generate these paths at all, it can happen as a consequence of incorrect canonical paths.

Partial fix for #1369

A while back we changed the type of `Path.Resolved.identifier` so we
could return `None` for the case where there is genuinely no identifier
that can be used. This was initially for to allow paths to core types
to be resolved, even though there's no destination for them.

This commit extends this idea so that attempting to generate an identifier
for a hidden path will result in `None`. Whilst we would prefer not to
generate these paths at all, it can happen as a consequence of incorrect
canonical paths.

Partial fix for ocaml#1369
@jonludlam jonludlam merged commit 4a9bfcb into ocaml:master Jul 15, 2025
11 checks passed
jonludlam added a commit to jonludlam/opam-repository that referenced this pull request Jul 15, 2025
CHANGES:

### Added
- Exposed sherlodoc libraries for use in other projects (@jonludlam, ocaml/odoc#1349)
- OCaml 5.4.0 support (@Octachron, ocaml/odoc#1355)
- New arguments to LaTeX generator, --shorten-beyond-depth and
  --remove-functor-arg-link (@Octachron, ocaml/odoc#1337)
- New experimental markdown generator (@davesnx, ocaml/odoc#1341)

### Changed
- Remove cmdliner compatibility layer, no longer needed (@dbuenzli, ocaml/odoc#1328)
- Drop support for OCaml < 4.08 (@jonludlam, ocaml/odoc#1300)
- Allow referencing libraries from package added in `odoc-config.sexp`
  (@panglesd, ocaml/odoc#1343)
- Use full path in heading labels in LaTeX backend (@Octachron, ocaml/odoc#1332)
- Separate page from anchor in LaTeX labels to prevent collisions (@Octachron,
  ocaml/odoc#1337)

### Fixed
- Fix bug in parsing META files when there are no dependencies (@jonludlam, ocaml/odoc#1352)
- Fix ocaml/odoc#1335 - incorrect rendering when on medium screen size with no global
  sidebar (@lukemaurer, ocaml/odoc#1361)
- Fixed generation of occurrences for docs CI (@jonludlam, ocaml/odoc#1362)
- Partial fix for ocaml/odoc#1369 - ensure that we never create a link to a hidden page
  (@jonludlam, ocaml/odoc#1370)
jonludlam added a commit to jonludlam/opam-repository that referenced this pull request Jul 15, 2025
CHANGES:

- Exposed sherlodoc libraries for use in other projects (@jonludlam, ocaml/odoc#1349)
- OCaml 5.4.0 support (@Octachron, ocaml/odoc#1355)
- New arguments to LaTeX generator, --shorten-beyond-depth and
  --remove-functor-arg-link (@Octachron, ocaml/odoc#1337)
- New experimental markdown generator (@davesnx, ocaml/odoc#1341)

- Remove cmdliner compatibility layer, no longer needed (@dbuenzli, ocaml/odoc#1328)
- Drop support for OCaml < 4.08 (@jonludlam, ocaml/odoc#1300)
- Allow referencing libraries from package added in `odoc-config.sexp`
  (@panglesd, ocaml/odoc#1343)
- Use full path in heading labels in LaTeX backend (@Octachron, ocaml/odoc#1332)
- Separate page from anchor in LaTeX labels to prevent collisions (@Octachron,
  ocaml/odoc#1337)

- Fix bug in parsing META files when there are no dependencies (@jonludlam, ocaml/odoc#1352)
- Fix ocaml/odoc#1335 - incorrect rendering when on medium screen size with no global
  sidebar (@lukemaurer, ocaml/odoc#1361)
- Fixed generation of occurrences for docs CI (@jonludlam, ocaml/odoc#1362)
- Partial fix for ocaml/odoc#1369 - ensure that we never create a link to a hidden page
  (@jonludlam, ocaml/odoc#1370)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant