Skip to content

Commit 8d2678c

Browse files
committed
Improvements following review
Apply @panglesd's suggestion and fix the test as 'diff' gives a different output on Alpine.
1 parent 20c1a69 commit 8d2678c

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/html/link.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,4 @@ let href ~config ~resolve t =
117117
in
118118
match (relative_target, anchor) with
119119
| [], "" -> "#"
120-
| page, "" -> String.concat "/" page
121-
| page, anchor -> String.concat "/" page ^ "#" ^ anchor))
120+
| page, _ -> add_anchor @@ String.concat "/" page))

test/integration/remap.t/run.t

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,9 @@ We should be able to remap the links to one of the packages:
1010
$ odoc html-generate -o _html --indent _odoc/prefix/mypkg/doc/test.odocl
1111
$ odoc html-generate -o _html2 --indent _odoc/prefix/mypkg/doc/test.odocl -R prefix/otherpkg/:https://mysite.org/p/otherpkg/1.2.3/
1212

13-
$ diff _html/prefix/mypkg/doc/Test/index.html _html2/prefix/mypkg/doc/Test/index.html
14-
25c25,27
15-
< <a href="../../../otherpkg/doc/Otherlib/index.html#type-t">Otherlib.t
16-
---
17-
> <a
18-
> href="https://mysite.org/p/otherpkg/1.2.3/doc/Otherlib/index.html#type-t"
19-
> >Otherlib.t
20-
[1]
13+
$ grep Otherlib/index.html _html/prefix/mypkg/doc/Test/index.html _html2/prefix/mypkg/doc/Test/index.html
14+
_html/prefix/mypkg/doc/Test/index.html: <a href="../../../otherpkg/doc/Otherlib/index.html#type-t">Otherlib.t
15+
_html2/prefix/mypkg/doc/Test/index.html: href="https://mysite.org/p/otherpkg/1.2.3/doc/Otherlib/index.html#type-t"
2116

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

0 commit comments

Comments
 (0)