Fix local hrefs

The id attribute needs the id name without '#' while in the anchor href
we need to prefix with '#'.
This commit is contained in:
Reynir Björnsson 2022-11-08 10:09:06 +01:00
parent 2f632fc4c3
commit 5722fccf31

View file

@ -864,10 +864,11 @@ let compare_builds
= =
let items, data = let items, data =
List.fold_left (fun (items, data) (id, txt, amount, code) -> List.fold_left (fun (items, data) (id, txt, amount, code) ->
let id_href = "#" ^ id in
if amount = 0 then if amount = 0 then
items, data items, data
else else
H.li [ H.a ~a:[H.a_href id] [txtf "%d %s" amount txt] ] :: items, H.li [ H.a ~a:[H.a_href id_href] [txtf "%d %s" amount txt] ] :: items,
data @ H.h3 ~a:[H.a_id id] [H.txt txt] :: code) data @ H.h3 ~a:[H.a_id id] [H.txt txt] :: code)
([], []) ([], [])
[ ("opam-packages-removed", "Opam packages removed", [ ("opam-packages-removed", "Opam packages removed",
@ -882,7 +883,7 @@ let compare_builds
List.length duniverse_right, [ H.code (duniverse_dirs duniverse_right) ]) ; List.length duniverse_right, [ H.code (duniverse_dirs duniverse_right) ]) ;
("duniverse-dirs-content-diff", "Duniverse directories with content changes", ("duniverse-dirs-content-diff", "Duniverse directories with content changes",
List.length duniverse_content_diff, [ H.code (duniverse_diffs duniverse_content_diff) ]) ; List.length duniverse_content_diff, [ H.code (duniverse_diffs duniverse_content_diff) ]) ;
("#opam-packages-opam-diff", "Opam packages with changes in their opam file", ("opam-packages-opam-diff", "Opam packages with changes in their opam file",
List.length opam_diff, opam_diffs opam_diff) ; List.length opam_diff, opam_diffs opam_diff) ;
("env-removed", "Environment variables removed", ("env-removed", "Environment variables removed",
List.length removed_env, [ H.code (key_values removed_env) ]) ; List.length removed_env, [ H.code (key_values removed_env) ]) ;