diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-07-07 15:03:43 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-07-07 15:03:43 +0000 |
commit | 9c359af9bb1bd8e1d69f8127bdd52825bd3b8014 (patch) | |
tree | 3d3b9aa7139c4a1108f3039cf9e3a4be4794ce08 | |
parent | 04736aac15e84c2dacbbb0788d3e89d2daf75cd4 (diff) | |
download | mandoc-9c359af9bb1bd8e1d69f8127bdd52825bd3b8014.tar.gz |
no need to skip content before first section header
-rw-r--r-- | mandoc.h | 1 | ||||
-rw-r--r-- | mdoc.c | 21 | ||||
-rw-r--r-- | mdoc_term.c | 5 | ||||
-rw-r--r-- | read.c | 1 |
4 files changed, 4 insertions, 24 deletions
@@ -139,7 +139,6 @@ enum mandocerr { MANDOCERR_BADCHAR, /* skipping bad character */ MANDOCERR_NAMESC, /* escaped character not allowed in a name */ MANDOCERR_NONAME, /* manual name not yet set */ - MANDOCERR_NOTEXT, /* skipping text before first section header */ MANDOCERR_MACRO, /* skipping unknown macro */ MANDOCERR_ARGCOUNT, /* argument count wrong */ MANDOCERR_RS_SKIP, /* skipping invalid content in .Rs block: macro */ @@ -227,13 +227,6 @@ mdoc_addeqn(struct mdoc *mdoc, const struct eqn *ep) assert( ! (MDOC_HALT & mdoc->flags)); - /* No text before an initial macro. */ - - if (SEC_NONE == mdoc->lastnamed) { - mdoc_pmsg(mdoc, ep->ln, ep->pos, MANDOCERR_NOTEXT); - return(1); - } - n = node_alloc(mdoc, ep->ln, ep->pos, MDOC_MAX, MDOC_EQN); n->eqn = ep; @@ -251,13 +244,6 @@ mdoc_addspan(struct mdoc *mdoc, const struct tbl_span *sp) assert( ! (MDOC_HALT & mdoc->flags)); - /* No text before an initial macro. */ - - if (SEC_NONE == mdoc->lastnamed) { - mdoc_pmsg(mdoc, sp->line, 0, MANDOCERR_NOTEXT); - return(1); - } - n = node_alloc(mdoc, sp->line, 0, MDOC_MAX, MDOC_TBL); n->span = sp; @@ -722,13 +708,6 @@ mdoc_ptext(struct mdoc *mdoc, int line, char *buf, int offs) char *c, *ws, *end; struct mdoc_node *n; - /* No text before an initial macro. */ - - if (SEC_NONE == mdoc->lastnamed) { - mdoc_pmsg(mdoc, line, offs, MANDOCERR_NOTEXT); - return(1); - } - assert(mdoc->last); n = mdoc->last; diff --git a/mdoc_term.c b/mdoc_term.c index 7c32cc2b..7ca42a50 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -275,8 +275,11 @@ terminal_mdoc(void *arg, const struct mdoc *mdoc) term_begin(p, print_mdoc_head, print_mdoc_foot, meta); - if (n->child) + if (n->child) { + if (MDOC_Sh != n->child->tok) + term_vspace(p); print_mdoc_nodelist(p, NULL, meta, n->child); + } term_end(p); } @@ -183,7 +183,6 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "skipping bad character", "escaped character not allowed in a name", "manual name not yet set", - "skipping text before first section header", "skipping unknown macro", "argument count wrong", "skipping invalid content in .Rs block", |