diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-25 11:42:02 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-25 11:42:02 +0000 |
commit | dc6214fb3f60d952ff46ee401174d7d534daf482 (patch) | |
tree | 47b5526c4b19564e530c2283b6ff5deb173c3633 /man_html.c | |
parent | 223d9e7a98a0a195709f8d69eb038ebc98598fe3 (diff) | |
download | mandoc-dc6214fb3f60d952ff46ee401174d7d534daf482.tar.gz |
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.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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); |