summaryrefslogtreecommitdiffstats
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-11-27 22:27:56 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-11-27 22:27:56 +0000
commite60121aa36205c920bf51da52a8b1ca357beb594 (patch)
tree8d4860c2d4c0b1a2e0e6910484195594fd0cfb87 /mdoc_term.c
parent45fbe869155402e8d8a4dbfce5516c55d9563890 (diff)
downloadmandoc-e60121aa36205c920bf51da52a8b1ca357beb594.tar.gz
Multiple fixes with respect to .Eo:
1. Correctly parse stray .Ec without preceding .Eo, avoiding an assertion violation found by jsg@ with afl. 2. Correctly parse .Ec arguments when breaking another block. 3. Correct spacing around closing delimiter when breaking another block. 4. Sync some related formatting control from -Tascii to -Thtml.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 379a0356..60dd9f8e 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -350,7 +350,8 @@ print_mdoc_node(DECL_ARGS)
term_tbl(p, n->span);
break;
default:
- if (termacts[n->tok].pre && ENDBODY_NOT == n->end)
+ if (termacts[n->tok].pre &&
+ (n->end == ENDBODY_NOT || n->nchild))
chld = (*termacts[n->tok].pre)
(p, &npair, meta, n);
break;
@@ -1917,10 +1918,11 @@ static void
termp_quote_post(DECL_ARGS)
{
- if (MDOC_BODY != n->type && MDOC_ELEM != n->type)
+ if (n->type != MDOC_BODY && n->type != MDOC_ELEM)
return;
- if (MDOC_En != n->tok)
+ if ( ! (n->tok == MDOC_En ||
+ (n->tok == MDOC_Eo && n->end == ENDBODY_SPACE)))
p->flags |= TERMP_NOSPACE;
switch (n->tok) {