Skip to content

Commit

Permalink
Improvements following review
Browse files Browse the repository at this point in the history
Apply @panglesd's suggestion and fix the test as 'diff' gives a different
output on Alpine.
  • Loading branch information
jonludlam committed Aug 27, 2024
1 parent 69320ef commit e2a25a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/html/link.ml
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,4 @@ let href ~config ~resolve t =
in
match (relative_target, anchor) with
| [], "" -> "#"
| page, "" -> String.concat "/" page
| page, anchor -> String.concat "/" page ^ "#" ^ anchor))
| page, _ -> add_anchor @@ String.concat "/" page))
11 changes: 3 additions & 8 deletions test/integration/remap.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@ We should be able to remap the links to one of the packages:
$ odoc html-generate -o _html --indent _odoc/prefix/mypkg/doc/test.odocl
$ odoc html-generate -o _html2 --indent _odoc/prefix/mypkg/doc/test.odocl -R prefix/otherpkg/:https://mysite.org/p/otherpkg/1.2.3/

$ diff _html/prefix/mypkg/doc/Test/index.html _html2/prefix/mypkg/doc/Test/index.html
25c25,27
< <a href="../../../otherpkg/doc/Otherlib/index.html#type-t">Otherlib.t
---
> <a
> href="https://mysite.org/p/otherpkg/1.2.3/doc/Otherlib/index.html#type-t"
> >Otherlib.t
[1]
$ grep Otherlib/index.html _html/prefix/mypkg/doc/Test/index.html _html2/prefix/mypkg/doc/Test/index.html
_html/prefix/mypkg/doc/Test/index.html: <a href="../../../otherpkg/doc/Otherlib/index.html#type-t">Otherlib.t
_html2/prefix/mypkg/doc/Test/index.html: href="https://mysite.org/p/otherpkg/1.2.3/doc/Otherlib/index.html#type-t"

This shouldn't stop us from outputting the remapped package though, and the following should complete without error

Expand Down

0 comments on commit e2a25a1

Please sign in to comment.