aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-07-25 14:18:04 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-07-25 14:18:04 +0000
commit8d1eb6e0f53824d1567a91f3def033e3cd01a9a2 (patch)
treef43abd9ed70a5d9983da601ae2b6409b3e82289a /mdoc_term.c
parent1001fe029bca51173d79b3b314825dc33a40bb65 (diff)
downloadmandoc-8d1eb6e0f53824d1567a91f3def033e3cd01a9a2.tar.gz
mandoc-8d1eb6e0f53824d1567a91f3def033e3cd01a9a2.tar.zst
mandoc-8d1eb6e0f53824d1567a91f3def033e3cd01a9a2.zip
basic tag support for function names; written at YYC
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index bed304c1..7486fa44 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.321 2015/07/25 14:02:06 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.322 2015/07/25 14:18:04 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -251,6 +251,7 @@ static const struct termact termacts[MDOC_MAX] = {
{ termp_ll_pre, NULL }, /* ll */
};
+static int fn_prio;
void
terminal_mdoc(void *arg, const struct roff_man *mdoc)
@@ -1364,7 +1365,7 @@ termp_sh_pre(DECL_ARGS)
* when the previous section was empty.
*/
if (n->prev == NULL ||
- MDOC_Sh != n->prev->tok ||
+ n->prev->tok != MDOC_Sh ||
(n->prev->body != NULL &&
n->prev->body->child != NULL))
term_vspace(p);
@@ -1374,8 +1375,16 @@ termp_sh_pre(DECL_ARGS)
break;
case ROFFT_BODY:
p->offset = term_len(p, p->defindent);
- if (SEC_AUTHORS == n->sec)
+ switch (n->sec) {
+ case SEC_DESCRIPTION:
+ fn_prio = 0;
+ break;
+ case SEC_AUTHORS:
p->flags &= ~(TERMP_SPLIT|TERMP_NOSPLIT);
+ break;
+ default:
+ break;
+ }
break;
default:
break;
@@ -1471,6 +1480,11 @@ termp_fn_pre(DECL_ARGS)
term_word(p, n->string);
term_fontpop(p);
+ if (n->sec == SEC_DESCRIPTION) {
+ if ( ! tag_get(n->string, 0, ++fn_prio))
+ tag_put(n->string, 0, fn_prio, p->line);
+ }
+
if (pretty) {
term_flushln(p);
p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG);
@@ -1823,6 +1837,7 @@ termp_sp_pre(DECL_ARGS)
break;
default:
len = 1;
+ fn_prio = 0;
break;
}