=================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.339 retrieving revision 1.340 diff -u -p -r1.339 -r1.340 --- mandoc/mdoc_html.c 2020/04/18 20:40:10 1.339 +++ mandoc/mdoc_html.c 2020/04/19 15:16:56 1.340 @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.339 2020/04/18 20:40:10 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.340 2020/04/19 15:16:56 schwarze Exp $ */ /* * Copyright (c) 2014-2020 Ingo Schwarze * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons @@ -695,8 +695,10 @@ mdoc_tg_pre(MDOC_ARGS) { char *id; - if ((id = html_make_id(n, 1)) != NULL) + if ((id = html_make_id(n, 1)) != NULL) { print_tagq(h, print_otag(h, TAG_MARK, "i", id)); + free(id); + } return 0; } @@ -1211,6 +1213,8 @@ mdoc_skip_pre(MDOC_ARGS) static int mdoc_pp_pre(MDOC_ARGS) { + char *id; + if (n->flags & NODE_NOFILL) { print_endline(h); if (n->flags & NODE_ID) @@ -1221,8 +1225,9 @@ mdoc_pp_pre(MDOC_ARGS) } } else { html_close_paragraph(h); - print_otag(h, TAG_P, "ci", "Pp", - n->flags & NODE_ID ? html_make_id(n, 1) : NULL); + id = n->flags & NODE_ID ? html_make_id(n, 1) : NULL; + print_otag(h, TAG_P, "ci", "Pp", id); + free(id); } return 0; }