aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2012-07-08 22:49:29 +0000
committerIngo Schwarze <schwarze@openbsd.org>2012-07-08 22:49:29 +0000
commit388dd18582f940023baf73dca5073083d773b908 (patch)
treebae7b9069d37520e3cc05b673905f3c706390202 /mdoc_man.c
parent6b73c29c454551394bd4ec1bd33e11febceaec68 (diff)
downloadmandoc-388dd18582f940023baf73dca5073083d773b908.tar.gz
mandoc-388dd18582f940023baf73dca5073083d773b908.tar.zst
mandoc-388dd18582f940023baf73dca5073083d773b908.zip
fix .Lk for -Tascii and implement it for -Tman
OpenBSD rev. 1.22 and 1.142, respectively
Diffstat (limited to 'mdoc_man.c')
-rw-r--r--mdoc_man.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/mdoc_man.c b/mdoc_man.c
index 4e1cba57..900c225e 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_man.c,v 1.23 2012/07/08 18:39:47 schwarze Exp $ */
+/* $Id: mdoc_man.c,v 1.24 2012/07/08 22:49:29 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -70,6 +70,7 @@ static int pre_fo(DECL_ARGS);
static int pre_ft(DECL_ARGS);
static int pre_in(DECL_ARGS);
static int pre_it(DECL_ARGS);
+static int pre_lk(DECL_ARGS);
static int pre_nm(DECL_ARGS);
static int pre_ns(DECL_ARGS);
static int pre_pp(DECL_ARGS);
@@ -199,7 +200,7 @@ static const struct manact manacts[MDOC_MAX + 1] = {
{ NULL, pre_ux, NULL, "currently under development.", NULL }, /* Ud */
{ NULL, NULL, post_lb, NULL, NULL }, /* Lb */
{ NULL, pre_pp, NULL, NULL, NULL }, /* Lp */
- { NULL, NULL, NULL, NULL, NULL }, /* _Lk */
+ { NULL, pre_lk, NULL, NULL, NULL }, /* Lk */
{ NULL, NULL, NULL, NULL, NULL }, /* _Mt */
{ cond_body, pre_enc, post_enc, "{", "}" }, /* Brq */
{ cond_body, pre_enc, post_enc, "{", "}" }, /* Bro */
@@ -831,6 +832,34 @@ post_lb(DECL_ARGS)
}
static int
+pre_lk(DECL_ARGS)
+{
+ const struct mdoc_node *link, *descr;
+
+ if (NULL == (link = n->child))
+ return(0);
+
+ if (NULL != (descr = link->next)) {
+ print_word("\\fI");
+ outflags &= ~MMAN_spc;
+ while (NULL != descr) {
+ print_word(descr->string);
+ descr = descr->next;
+ }
+ print_word(":");
+ outflags &= ~MMAN_spc;
+ print_word("\\fP");
+ }
+
+ print_word("\\fB");
+ outflags &= ~MMAN_spc;
+ print_word(link->string);
+ outflags &= ~MMAN_spc;
+ print_word("\\fP");
+ return(0);
+}
+
+static int
pre_nm(DECL_ARGS)
{