diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-05-23 22:45:02 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-05-23 22:45:02 +0000 |
commit | 5f11e83ec40e027d9941a83310ca46e5e32821c7 (patch) | |
tree | 443369858d56a918cd55fb337d34f528d8d4d96b /usr.bin/mandoc/mdoc_html.c | |
parent | 22bfa887a3d98fe67ad553bf37793e74ab6f8142 (diff) |
Unified error and warning message system for all of mandoc,
featuring three message levels, as agreed during the mandoc hackathon:
* FATAL parser failure, cannot produce any output from this input file:
eventually, we hope to convert most of these to ERRORs.
* ERROR, meaning mandoc cannot cope fully with the input syntax and will
probably lose information or produce structurally garbled output;
it will try to produce output anyway but exit non-zero at the end,
which is eventually intended to make the ports infrastructure happy.
* WARNING, meaning you should clean up the input file, but output
is probably mostly OK, so this will not cause error-exit at the end.
This commit is mostly just converting the old system to the new one; before
the classification will become really reliable, we must check all messages.
In particular,
* set up a new central message string table in main.c
* drop the old message string tables from man.c and mdoc.c
* get rid of the piece-meal merr enums in libman and libmdoc
* reduce number of error/warning functions from 16 to 6 (still a lot...)
While here, handle a few problems more gracefully:
* allow .Rv and .Ex to work without a prior .Nm
* allow .An to ignore extra arguments
* allow undeclared columns in .Bl -column
Written by kristaps@.
Diffstat (limited to 'usr.bin/mandoc/mdoc_html.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_html.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c index 48ee6ae7338..8862f9f22c7 100644 --- a/usr.bin/mandoc/mdoc_html.c +++ b/usr.bin/mandoc/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.16 2010/05/23 20:05:43 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.17 2010/05/23 22:45:00 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -23,6 +23,7 @@ #include <string.h> #include <unistd.h> +#include "mandoc.h" #include "out.h" #include "html.h" #include "mdoc.h" @@ -725,6 +726,9 @@ mdoc_nm_pre(MDOC_ARGS) { struct htmlpair tag; + if (NULL == n->child && NULL == m->name) + return(1); + if (SEC_SYNOPSIS == n->sec && n->prev && MDOC_LINE & n->flags) { bufcat_style(h, "clear", "both"); @@ -1177,7 +1181,7 @@ mdoc_ex_pre(MDOC_ARGS) h->flags &= ~HTML_NOSPACE; } - if (n->child->next) + if (n->child && n->child->next) print_text(h, "utilities exit"); else print_text(h, "utility exits"); @@ -1947,7 +1951,7 @@ mdoc_rv_pre(MDOC_ARGS) print_text(h, "()"); } - if (n->child->next) + if (n->child && n->child->next) print_text(h, "functions return"); else print_text(h, "function returns"); |