diff options
-rw-r--r-- | man.7 | 14 | ||||
-rw-r--r-- | man_html.c | 11 | ||||
-rw-r--r-- | man_term.c | 2 | ||||
-rw-r--r-- | man_validate.c | 4 | ||||
-rw-r--r-- | mandoc.1 | 8 | ||||
-rw-r--r-- | roff.c | 2 | ||||
-rw-r--r-- | roff.h | 2 |
7 files changed, 38 insertions, 5 deletions
@@ -466,6 +466,20 @@ See also .Sx \&PP , and .Sx \&TP . +.Ss \&ME +End a mailto block. +This is a non-standard GNU extension, included only for compatibility. +See +.Sx \&MT . +.Ss \&MT +Begin a mailto block. +This is a non-standard GNU extension, included only for compatibility. +It has the following syntax: +.Bd -literal -offset indent +.Pf \. Sx \&MT Ar address +link description to be shown +.Pf \. Sx ME +.Ed .Ss \&OP Optional command-line argument. This is a non-standard GNU extension, included only for compatibility. @@ -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); @@ -128,6 +128,8 @@ static const struct termact __termacts[MAN_MAX - MAN_TH] = { { pre_literal, NULL, 0 }, /* EE */ { pre_UR, post_UR, 0 }, /* UR */ { NULL, NULL, 0 }, /* UE */ + { pre_UR, post_UR, 0 }, /* MT */ + { NULL, NULL, 0 }, /* ME */ }; static const struct termact *termacts = __termacts - MAN_TH; diff --git a/man_validate.c b/man_validate.c index e874cabb..12ba6e22 100644 --- a/man_validate.c +++ b/man_validate.c @@ -89,6 +89,8 @@ static const v_check __man_valids[MAN_MAX - MAN_TH] = { NULL, /* EE */ post_UR, /* UR */ NULL, /* UE */ + post_UR, /* MT */ + NULL, /* ME */ }; static const v_check *man_valids = __man_valids - MAN_TH; @@ -212,7 +214,7 @@ post_UR(CHKARGS) if (n->type == ROFFT_HEAD && n->child == NULL) mandoc_vmsg(MANDOCERR_UR_NOHEAD, man->parse, - n->line, n->pos, "UR"); + n->line, n->pos, roff_name[n->tok]); check_part(man, n); } @@ -1278,6 +1278,7 @@ A .Ic \&Bl , .Ic \&D1 , .Ic \&Dl , +.Ic \&MT , .Ic \&RS , or .Ic \&UR @@ -1413,6 +1414,8 @@ An empty pair of square brackets is shown. .It Sy "missing resource identifier, using \(dq\(dq" .Pq man The +.Ic \&MT +or .Ic \&UR macro is invoked without any argument. An empty pair of angle brackets is shown. @@ -1765,7 +1768,7 @@ An .Xr mdoc 7 block closing macro, a .Xr man 7 -.Ic \&RE +.Ic \&ME , \&RE or .Ic \&UE macro, an @@ -1799,7 +1802,7 @@ At the end of the document, an explicit block, a .Xr man 7 next-line scope or -.Ic \&RS +.Ic \&MT , \&RS or .Ic \&UR block, an equation, table, or @@ -1971,6 +1974,7 @@ A macro or request is invoked with too many arguments: .Bl -dash -offset 2n -width 2n -compact .It .Ic \&Fo , +.Ic \&MT , .Ic \&PD , .Ic \&RS , .Ic \&UR , @@ -330,7 +330,7 @@ const char *__roff_name[MAN_MAX + 1] = { "RE", "RS", "DT", "UC", "PD", "AT", "in", "OP", "EX", "EE", "UR", - "UE", NULL + "UE", "MT", "ME", NULL }; const char *const *roff_name = __roff_name; @@ -467,6 +467,8 @@ enum roff_tok { MAN_EE, MAN_UR, MAN_UE, + MAN_MT, + MAN_ME, MAN_MAX }; |