=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_html.c,v retrieving revision 1.178 retrieving revision 1.179 diff -c -r1.178 -r1.179 *** src/usr.bin/mandoc/mdoc_html.c 2018/05/21 01:10:06 1.178 --- src/usr.bin/mandoc/mdoc_html.c 2018/05/25 20:23:39 1.179 *************** *** 1,4 **** ! /* $OpenBSD: mdoc_html.c,v 1.178 2018/05/21 01:10:06 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014,2015,2016,2017,2018 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: mdoc_html.c,v 1.179 2018/05/25 20:23:39 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014,2015,2016,2017,2018 Ingo Schwarze *************** *** 500,506 **** (n->parent->tok == MDOC_Xo && n->parent->parent->prev == NULL && n->parent->parent->parent->tok == MDOC_It))) ! return html_make_id(n); return NULL; } --- 500,506 ---- (n->parent->tok == MDOC_Xo && n->parent->parent->prev == NULL && n->parent->parent->parent->tok == MDOC_It))) ! return html_make_id(n, 1); return NULL; } *************** *** 511,521 **** switch (n->type) { case ROFFT_HEAD: ! id = html_make_id(n); print_otag(h, TAG_H1, "cTi", "Sh", id); if (id != NULL) print_otag(h, TAG_A, "chR", "permalink", id); - free(id); break; case ROFFT_BODY: if (n->sec == SEC_AUTHORS) --- 511,520 ---- switch (n->type) { case ROFFT_HEAD: ! 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); break; case ROFFT_BODY: if (n->sec == SEC_AUTHORS) *************** *** 535,545 **** if (n->type != ROFFT_HEAD) return 1; ! id = html_make_id(n); print_otag(h, TAG_H2, "cTi", "Ss", id); if (id != NULL) print_otag(h, TAG_A, "chR", "permalink", id); - free(id); return 1; } --- 534,543 ---- if (n->type != ROFFT_HEAD) return 1; ! 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); return 1; } *************** *** 551,557 **** if ((id = cond_id(n)) != NULL) print_otag(h, TAG_A, "chR", "permalink", id); print_otag(h, TAG_CODE, "cTi", "Fl", id); - free(id); print_text(h, "\\-"); if (!(n->child == NULL && --- 549,554 ---- *************** *** 571,577 **** if ((id = cond_id(n)) != NULL) print_otag(h, TAG_A, "chR", "permalink", id); print_otag(h, TAG_CODE, "cTi", "Cm", id); - free(id); return 1; } --- 568,573 ---- *************** *** 880,886 **** { char *id; ! id = html_make_id(n); print_otag(h, TAG_A, "cThR", "Sx", id); free(id); return 1; --- 876,882 ---- { char *id; ! id = html_make_id(n, 0); print_otag(h, TAG_A, "cThR", "Sx", id); free(id); return 1; *************** *** 1028,1034 **** if ((id = cond_id(n)) != NULL) print_otag(h, TAG_A, "chR", "permalink", id); print_otag(h, TAG_CODE, "cTi", "Dv", id); - free(id); return 1; } --- 1024,1029 ---- *************** *** 1040,1046 **** if ((id = cond_id(n)) != NULL) print_otag(h, TAG_A, "chR", "permalink", id); print_otag(h, TAG_CODE, "cTi", "Ev", id); - free(id); return 1; } --- 1035,1040 ---- *************** *** 1053,1064 **** (n->parent->tok == MDOC_It || (n->parent->tok == MDOC_Bq && n->parent->parent->parent->tok == MDOC_It)) ? ! html_make_id(n) : NULL; if (id != NULL) print_otag(h, TAG_A, "chR", "permalink", id); print_otag(h, TAG_CODE, "cTi", "Er", id); - free(id); return 1; } --- 1047,1057 ---- (n->parent->tok == MDOC_It || (n->parent->tok == MDOC_Bq && n->parent->parent->parent->tok == MDOC_It)) ? ! html_make_id(n, 1) : NULL; if (id != NULL) print_otag(h, TAG_A, "chR", "permalink", id); print_otag(h, TAG_CODE, "cTi", "Er", id); return 1; } *************** *** 1409,1415 **** if ((id = cond_id(n)) != NULL) print_otag(h, TAG_A, "chR", "permalink", id); print_otag(h, TAG_CODE, "cTi", "Ic", id); - free(id); return 1; } --- 1402,1407 ---- *************** *** 1462,1468 **** if ((id = cond_id(n)) != NULL) print_otag(h, TAG_A, "chR", "permalink", id); print_otag(h, TAG_SPAN, "cTi", "Ms", id); - free(id); return 1; } --- 1454,1459 ---- *************** *** 1503,1509 **** if ((id = cond_id(n)) != NULL) print_otag(h, TAG_A, "chR", "permalink", id); print_otag(h, TAG_SPAN, "ci", "No", id); - free(id); return 1; } --- 1494,1499 ---- *************** *** 1515,1521 **** if ((id = cond_id(n)) != NULL) print_otag(h, TAG_A, "chR", "permalink", id); print_otag(h, TAG_CODE, "ci", "Li", id); - free(id); return 1; } --- 1505,1510 ----