diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-03 21:00:10 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-03 21:00:10 +0000 |
commit | d504e7480ce979e924b1c4fe82bdbcaa790ca153 (patch) | |
tree | bf04b3cdea5ee4c901f9affaca31b1278bbb3272 /mdoc_markdown.c | |
parent | b612c0fc16de6270d13910388974b03b6bf27af8 (diff) | |
download | mandoc-d504e7480ce979e924b1c4fe82bdbcaa790ca153.tar.gz |
In the validators, translate obsolete macro aliases (Lp, Ot, LP, P)
to the standard forms (Pp, Ft, PP) up front, such that later code
does not need to look for the obsolete versions.
This reduces the risk of incomplete handling.
Diffstat (limited to 'mdoc_markdown.c')
-rw-r--r-- | mdoc_markdown.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/mdoc_markdown.c b/mdoc_markdown.c index 0cefcfac..b5a856a1 100644 --- a/mdoc_markdown.c +++ b/mdoc_markdown.c @@ -19,6 +19,7 @@ #include <assert.h> #include <ctype.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #include "mandoc_aux.h" @@ -48,6 +49,7 @@ static void md_uri(const char *); static int md_cond_head(struct roff_node *); static int md_cond_body(struct roff_node *); +static int md_pre_abort(struct roff_node *); static int md_pre_raw(struct roff_node *); static int md_pre_word(struct roff_node *); static int md_pre_skip(struct roff_node *); @@ -138,7 +140,7 @@ static const struct md_act md_acts[MDOC_MAX - MDOC_Dd] = { { md_cond_head, md_pre_Nd, NULL, NULL, NULL }, /* Nd */ { NULL, md_pre_Nm, md_post_Nm, "**", "**" }, /* Nm */ { md_cond_body, md_pre_word, md_post_word, "[", "]" }, /* Op */ - { NULL, md_pre_Fd, md_post_raw, "*", "*" }, /* Ot */ + { NULL, md_pre_abort, NULL, NULL, NULL }, /* Ot */ { NULL, md_pre_raw, md_post_raw, "*", "*" }, /* Pa */ { NULL, NULL, NULL, NULL, NULL }, /* Rv */ { NULL, NULL, NULL, NULL, NULL }, /* St */ @@ -211,7 +213,7 @@ static const struct md_act md_acts[MDOC_MAX - MDOC_Dd] = { { NULL, md_pre_raw, md_post_raw, "*", "*" }, /* Fr */ { NULL, NULL, NULL, NULL, NULL }, /* Ud */ { NULL, NULL, md_post_Lb, NULL, NULL }, /* Lb */ - { NULL, md_pre_Pp, NULL, NULL, NULL }, /* Lp */ + { NULL, md_pre_abort, NULL, NULL, NULL }, /* Lp */ { NULL, md_pre_Lk, NULL, NULL, NULL }, /* Lk */ { NULL, md_pre_Mt, NULL, NULL, NULL }, /* Mt */ { md_cond_body, md_pre_word, md_post_word, "{", "}" }, /* Brq */ @@ -723,6 +725,12 @@ md_cond_body(struct roff_node *n) } static int +md_pre_abort(struct roff_node *n) +{ + abort(); +} + +static int md_pre_raw(struct roff_node *n) { const char *prefix; |