aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-05-25 20:23:51 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-05-25 20:23:51 +0000
commite23a77096fcef5d491ce207daaa9ce6f57384647 (patch)
tree24b06648acd1a99d0cd34b090e6f214722a4d325 /man_html.c
parent546accec72e5db867d299b5616c26abec3a86c7d (diff)
downloadmandoc-e23a77096fcef5d491ce207daaa9ce6f57384647.tar.gz
mandoc-e23a77096fcef5d491ce207daaa9ce6f57384647.tar.zst
mandoc-e23a77096fcef5d491ce207daaa9ce6f57384647.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 'man_html.c')
-rw-r--r--man_html.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/man_html.c b/man_html.c
index e8b4138c..90f45528 100644
--- a/man_html.c
+++ b/man_html.c
@@ -1,4 +1,4 @@
-/* $Id: man_html.c,v 1.149 2018/05/08 21:42:34 schwarze Exp $ */
+/* $Id: man_html.c,v 1.150 2018/05/25 20:23:51 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -428,11 +428,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;
}
@@ -498,11 +497,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;
}