diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2009-07-18 22:07:10 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2009-07-18 22:07:10 +0000 |
commit | d0316a88ecf7ca1e78a81f84a731edbca85814ed (patch) | |
tree | e869d99950a46316861ed2be8e85867a612daa05 /usr.bin/mandoc/mdoc_term.c | |
parent | 7761ded52c6998610fd0f3d3a82b7b4b6ac63b25 (diff) |
sync to 1.8.0: a couple of cosmetic fixes:
1) use \(hy instead of \- for .Bl -hyphen (renders the same in -Tascii)
2) clear bold flag after printing the -bullet or -hyphen in .Bl
(actually, the flags will be reinitialized in termp_it_post, anyway)
3) do not redo the work of the parser in termp_rv_pre and termp_ex_pre
(instead, just assert() validity of the parse tree)
4) do not bother assigning to the offset in termp_ss_post
(it will soon be reinitialized in print_node, anyway)
Diffstat (limited to 'usr.bin/mandoc/mdoc_term.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_term.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c index f5776f2c891..f6a51953344 100644 --- a/usr.bin/mandoc/mdoc_term.c +++ b/usr.bin/mandoc/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.34 2009/07/18 21:16:49 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.35 2009/07/18 22:07:09 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -922,12 +922,14 @@ termp_it_pre(DECL_ARGS) case (MDOC_Bullet): p->flags |= TERMP_BOLD; term_word(p, "\\[bu]"); + p->flags &= ~TERMP_BOLD; break; case (MDOC_Dash): /* FALLTHROUGH */ case (MDOC_Hyphen): p->flags |= TERMP_BOLD; - term_word(p, "\\-"); + term_word(p, "\\(hy"); + p->flags &= ~TERMP_BOLD; break; case (MDOC_Enum): (pair->ppair->ppair->count)++; @@ -1080,12 +1082,9 @@ termp_rv_pre(DECL_ARGS) { int i; - /* FIXME: mandated by parser. */ - - if (-1 == (i = arg_getattr(MDOC_Std, node))) - errx(1, "expected -std argument"); - if (1 != node->args->argv[i].sz) - errx(1, "expected -std argument"); + i = arg_getattr(MDOC_Std, node); + assert(-1 != i); + assert(node->args->argv[i].sz); term_newln(p); term_word(p, "The"); @@ -1115,12 +1114,9 @@ termp_ex_pre(DECL_ARGS) { int i; - /* FIXME: mandated by parser? */ - - if (-1 == (i = arg_getattr(MDOC_Std, node))) - errx(1, "expected -std argument"); - if (1 != node->args->argv[i].sz) - errx(1, "expected -std argument"); + i = arg_getattr(MDOC_Std, node); + assert(-1 != i); + assert(node->args->argv[i].sz); term_word(p, "The"); p->flags |= ttypes[TTYPE_PROG]; @@ -1734,14 +1730,8 @@ static void termp_ss_post(DECL_ARGS) { - switch (node->type) { - case (MDOC_HEAD): + if (MDOC_HEAD == node->type) term_newln(p); - p->offset = INDENT; - break; - default: - break; - } } |