From 0c8f9a78c144e759fc8ce4b1b92b1787474385bd Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 13 Apr 2018 16:28:07 +0000 Subject: preserve comments before .Dd and .TH (typically Copyright and license) in full HTML output, but not with -Ofragment, e.g. in man.cgi(8); suggested by Thomas Klausner --- html.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index 65f7eea4..68ec1f14 100644 --- a/html.c +++ b/html.c @@ -1,7 +1,7 @@ -/* $Id: html.c,v 1.220 2017/09/06 16:24:25 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 @@ -770,6 +770,32 @@ print_gen_decls(struct html *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 print_text(struct html *h, const char *word) { -- cgit v1.2.3