aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2019-07-23 17:53:35 +0000
committerIngo Schwarze <schwarze@openbsd.org>2019-07-23 17:53:35 +0000
commitf297e8ee9d6c64721ec4be733153ad885f3fe569 (patch)
tree3532ece4d3b715bcb25695a829168eaf4fcb4acf /man_term.c
parent72cf85a98bb1b2a6ef04b580cfa7c6a0d5ae1b24 (diff)
downloadmandoc-f297e8ee9d6c64721ec4be733153ad885f3fe569.tar.gz
mandoc-f297e8ee9d6c64721ec4be733153ad885f3fe569.tar.zst
mandoc-f297e8ee9d6c64721ec4be733153ad885f3fe569.zip
tagging support for .TP and .TQ; try e.g. man -O tag=commit cvs
Diffstat (limited to 'man_term.c')
-rw-r--r--man_term.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/man_term.c b/man_term.c
index b051b2ec..d9ee14ad 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.231 2019/07/22 03:21:49 schwarze Exp $ */
+/* $Id: man_term.c,v 1.232 2019/07/23 17:53:35 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017-2019 Ingo Schwarze <schwarze@openbsd.org>
@@ -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;