summaryrefslogtreecommitdiffstats
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
commit08a70c0ec8737fa1eef21f338aea5d527de6e779 (patch)
tree5595ac694a287e63e09d4a508df2a22aded8fc2d /man_html.c
parent1f3a93e77917534228a285ef0cb54e575870b4dd (diff)
downloadmandoc-08a70c0ec8737fa1eef21f338aea5d527de6e779.tar.gz
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.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/man_html.c b/man_html.c
index 40ac0fa1..fc4bc692 100644
--- a/man_html.c
+++ b/man_html.c
@@ -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;
}