diff options
author | 2017-06-25 07:23:53 +0000 | |
---|---|---|
committer | 2017-06-25 07:23:53 +0000 | |
commit | df9a9479ddee899e1995f8eba1983628deecbec6 (patch) | |
tree | b8e6e4ef139aeae307e2542996421eae48da1dfc /usr.bin/mandoc/man_html.c | |
parent | ldd is more strict wrt semicolons, they can only appear after an (diff) | |
download | wireguard-openbsd-df9a9479ddee899e1995f8eba1983628deecbec6.tar.xz wireguard-openbsd-df9a9479ddee899e1995f8eba1983628deecbec6.zip |
Add support for the MT and ME mailto macros, used for example in wg(8).
feedback and ok schwarze@
Diffstat (limited to 'usr.bin/mandoc/man_html.c')
-rw-r--r-- | usr.bin/mandoc/man_html.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c index 5037efa8550..86f30b9901c 100644 --- a/usr.bin/mandoc/man_html.c +++ b/usr.bin/mandoc/man_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_html.c,v 1.97 2017/06/24 14:38:27 schwarze Exp $ */ +/* $OpenBSD: man_html.c,v 1.98 2017/06/25 07:23:53 bentley Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -104,6 +104,8 @@ static const struct htmlman __mans[MAN_MAX - MAN_TH] = { { NULL, NULL }, /* EE */ { man_UR_pre, NULL }, /* UR */ { NULL, NULL }, /* UE */ + { man_UR_pre, NULL }, /* MT */ + { NULL, NULL }, /* ME */ }; static const struct htmlman *const mans = __mans - MAN_TH; @@ -228,6 +230,7 @@ print_man_node(MAN_ARGS) case MAN_P: /* reopen .nf in the body. */ case MAN_RS: case MAN_UR: + case MAN_MT: fillmode(h, MAN_fi); break; default: @@ -642,11 +645,17 @@ man_RS_pre(MAN_ARGS) static int man_UR_pre(MAN_ARGS) { + char *cp; n = n->child; assert(n->type == ROFFT_HEAD); if (n->child != NULL) { assert(n->child->type == ROFFT_TEXT); - print_otag(h, TAG_A, "cTh", "Lk", n->child->string); + if (n->tok == MAN_MT) { + mandoc_asprintf(&cp, "mailto:%s", n->child->string); + print_otag(h, TAG_A, "cTh", "Mt", cp); + free(cp); + } else + print_otag(h, TAG_A, "cTh", "Lk", n->child->string); } assert(n->next->type == ROFFT_BODY); |