=================================================================== RCS file: /cvs/mandoc/html.c,v retrieving revision 1.219 retrieving revision 1.221 diff -u -p -r1.219 -r1.221 --- mandoc/html.c 2017/07/15 17:57:51 1.219 +++ mandoc/html.c 2018/04/13 16:28:07 1.221 @@ -1,7 +1,7 @@ -/* $Id: html.c,v 1.219 2017/07/15 17:57:51 schwarze Exp $ */ +/* $Id: html.c,v 1.221 2018/04/13 16:28:07 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons - * Copyright (c) 2011-2015, 2017 Ingo Schwarze + * Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -250,6 +250,8 @@ html_make_id(const struct roff_node *n) buf = NULL; deroff(&buf, n); + if (buf == NULL) + return NULL; /* http://www.w3.org/TR/html5/dom.html#the-id-attribute */ @@ -766,6 +768,32 @@ print_gen_decls(struct html *h) { print_word(h, ""); print_endline(h); +} + +void +print_gen_comment(struct html *h, struct roff_node *n) +{ + int wantblank; + + print_word(h, "") == NULL && + (wantblank || *n->string != '\0')) { + print_endline(h); + print_indent(h); + print_word(h, n->string); + wantblank = *n->string != '\0'; + } + n = n->next; + } + if (wantblank) + print_endline(h); + print_word(h, " -->"); + print_endline(h); + h->indent = 0; } void