diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-11-27 22:27:56 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-11-27 22:27:56 +0000 |
commit | 712cc4fb3fddd80d9848fe07c23d27279b248c65 (patch) | |
tree | b5c4c37a9970480b065b6ed0bb471793e17076a1 /mdoc_term.c | |
parent | ae5f77f4afb4eacc8500ded5455086d6242ae946 (diff) | |
download | mandoc-712cc4fb3fddd80d9848fe07c23d27279b248c65.tar.gz mandoc-712cc4fb3fddd80d9848fe07c23d27279b248c65.tar.zst mandoc-712cc4fb3fddd80d9848fe07c23d27279b248c65.zip |
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.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mdoc_term.c b/mdoc_term.c index 08a32850..9a73631a 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.294 2014/11/27 16:20:31 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.295 2014/11/27 22:27:56 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -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) { |