summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_html.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2018-05-25 20:23:39 +0000
committerschwarze <schwarze@openbsd.org>2018-05-25 20:23:39 +0000
commit762c10160221b056a3de179225731b5d84a95b42 (patch)
tree3476c8f34a5f164d3e26dcd3a80c341e02581a0a /usr.bin/mandoc/man_html.c
parentDocument that "from local" and "for local" are still the defaults. (diff)
downloadwireguard-openbsd-762c10160221b056a3de179225731b5d84a95b42.tar.xz
wireguard-openbsd-762c10160221b056a3de179225731b5d84a95b42.zip
Do not write duplicate id= attributes, they violate HTML syntax.
Append suffixes for disambiguation. Issue first reported by Jakub Klinkovsky <j dot l dot k at gmx dot com> (Arch Linux).
Diffstat (limited to 'usr.bin/mandoc/man_html.c')
-rw-r--r--usr.bin/mandoc/man_html.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c
index c7f7ea123d6..49d89429551 100644
--- a/usr.bin/mandoc/man_html.c
+++ b/usr.bin/mandoc/man_html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_html.c,v 1.102 2018/05/08 21:42:11 schwarze Exp $ */
+/* $OpenBSD: man_html.c,v 1.103 2018/05/25 20:23:39 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -426,11 +426,10 @@ man_SH_pre(MAN_ARGS)
char *id;
if (n->type == ROFFT_HEAD) {
- id = html_make_id(n);
+ id = html_make_id(n, 1);
print_otag(h, TAG_H1, "cTi", "Sh", id);
if (id != NULL)
print_otag(h, TAG_A, "chR", "permalink", id);
- free(id);
}
return 1;
}
@@ -496,11 +495,10 @@ man_SS_pre(MAN_ARGS)
char *id;
if (n->type == ROFFT_HEAD) {
- id = html_make_id(n);
+ id = html_make_id(n, 1);
print_otag(h, TAG_H2, "cTi", "Ss", id);
if (id != NULL)
print_otag(h, TAG_A, "chR", "permalink", id);
- free(id);
}
return 1;
}