aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-25 11:42:02 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-25 11:42:02 +0000
commit9d2ef545376117ce8b24ed652f358c029d7b8f4c (patch)
tree04be238fca39283691f2e1323ce5fb566a51c833 /man_html.c
parent81b56cdb2563a0ccc155f42f0c79a82f9ccbb22a (diff)
downloadmandoc-9d2ef545376117ce8b24ed652f358c029d7b8f4c.tar.gz
mandoc-9d2ef545376117ce8b24ed652f358c029d7b8f4c.tar.zst
mandoc-9d2ef545376117ce8b24ed652f358c029d7b8f4c.zip
add support for the MT and ME mailto macros, used for example in wg(8);
patch from bentley@
Diffstat (limited to 'man_html.c')
-rw-r--r--man_html.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/man_html.c b/man_html.c
index 127a46e0..a304b3e4 100644
--- a/man_html.c
+++ b/man_html.c
@@ -1,4 +1,4 @@
-/* $Id: man_html.c,v 1.144 2017/06/24 14:38:32 schwarze Exp $ */
+/* $Id: man_html.c,v 1.145 2017/06/25 11:42:02 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -106,6 +106,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;
@@ -230,6 +232,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:
@@ -644,11 +647,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);