X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/72cf85a98bb1b2a6ef04b580cfa7c6a0d5ae1b24..b0c127d2963d182de4289e4143f3edb38375cb47:/man_term.c diff --git a/man_term.c b/man_term.c index b051b2ec..553063dc 100644 --- a/man_term.c +++ b/man_term.c @@ -1,7 +1,7 @@ -/* $Id: man_term.c,v 1.231 2019/07/22 03:21:49 schwarze Exp $ */ +/* $Id: man_term.c,v 1.233 2020/01/20 10:37:15 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons - * Copyright (c) 2010-2015, 2017-2019 Ingo Schwarze + * Copyright (c) 2010-2015, 2017-2020 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -621,6 +621,18 @@ pre_TP(DECL_ARGS) while (nn != NULL && (nn->flags & NODE_LINE) == 0) nn = nn->next; + if (nn == NULL) + return 0; + + if (nn->type == ROFFT_TEXT) + tag_man(p, nn); + else if (nn->child != NULL && + nn->child->type == ROFFT_TEXT && + (nn->tok == MAN_B || nn->tok == MAN_BI || + nn->tok == MAN_BR || nn->tok == MAN_I || + nn->tok == MAN_IB || nn->tok == MAN_IR)) + tag_man(p, nn->child); + while (nn != NULL) { print_man_node(p, mt, nn, meta); nn = nn->next; @@ -1168,12 +1180,12 @@ tag_man(struct termp *p, struct roff_node *n) assert(n->type == ROFFT_TEXT); cp = n->string; - prio = 1; + prio = TAG_STRONG; for (;;) { switch (*cp) { case ' ': case '\t': - prio = INT_MAX; + prio = TAG_WEAK; /* FALLTHROUGH */ case '-': cp++;