diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-07-25 14:18:04 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-07-25 14:18:04 +0000 |
commit | 407d8b629d9eb8509d6396c80b98c0c51d6f2c9f (patch) | |
tree | 5c8845a85c4d5890730bb01e6e6135cc1be555d8 /mdoc_term.c | |
parent | 8ecd58a3e222c5d6df72c264a6aad988c28321a4 (diff) | |
download | mandoc-407d8b629d9eb8509d6396c80b98c0c51d6f2c9f.tar.gz |
basic tag support for function names; written at YYC
Diffstat (limited to 'mdoc_term.c')
-rw-r--r-- | mdoc_term.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/mdoc_term.c b/mdoc_term.c index 10ebbc51..0aeb281e 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -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; } |