summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man.714
-rw-r--r--man_html.c11
-rw-r--r--man_term.c2
-rw-r--r--man_validate.c4
-rw-r--r--mandoc.18
-rw-r--r--roff.c2
-rw-r--r--roff.h2
7 files changed, 38 insertions, 5 deletions
diff --git a/man.7 b/man.7
index 55cd88e8..1d292cb4 100644
--- a/man.7
+++ b/man.7
@@ -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.
diff --git a/man_html.c b/man_html.c
index 50df1580..8e8ef613 100644
--- a/man_html.c
+++ b/man_html.c
@@ -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);
diff --git a/man_term.c b/man_term.c
index f317aadf..e0348624 100644
--- a/man_term.c
+++ b/man_term.c
@@ -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);
}
diff --git a/mandoc.1 b/mandoc.1
index 69a5487e..0d85d914 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -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 ,
diff --git a/roff.c b/roff.c
index 7e773d22..c2b79034 100644
--- a/roff.c
+++ b/roff.c
@@ -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;
diff --git a/roff.h b/roff.h
index c2b12ff6..4665aac6 100644
--- a/roff.h
+++ b/roff.h
@@ -467,6 +467,8 @@ enum roff_tok {
MAN_EE,
MAN_UR,
MAN_UE,
+ MAN_MT,
+ MAN_ME,
MAN_MAX
};