From 33f9e754bd9e6f7a650ced4601cbace53561348a Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:21:21 -0700 Subject: Open site and repository links through one helper --- source/ui-shared.c | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) (limited to 'source') diff --git a/source/ui-shared.c b/source/ui-shared.c index afdf991..687b773 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -72,23 +72,11 @@ static void site_url(const char *page, const char *search, const char *sort, int } /* - * Write the class of a link, and mark the link as the current one for - * assistive technology when the class says it is the active tab or the + * Open an anchor up to the start of its href, marking the link as the current + * one for assistive technology when the class says it is the active tab or the * current page of a pager. */ -static void link_class(const char *class) -{ - if (!class) - return; - html(" class='"); - html_attr(class); - html("'"); - if (!strcmp(class, "active") || !strcmp(class, "current")) - html(" aria-current='page'"); -} - -static void site_link(const char *page, const char *name, const char *title, - const char *class, const char *search, const char *sort, int ofs, int always_root) +static void open_link(const char *title, const char *class) { html(""); html_txt(name); @@ -140,14 +140,7 @@ static const char *repolink(const char *title, const char *class, const char *pa { const char *delim = "?"; - html("