From 820b4d56427ff6a0f1e3399ac7e4aea447dd5c20 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 3 Dec 2018 21:00:10 +0000 Subject: 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. --- mdoc_markdown.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'mdoc_markdown.c') diff --git a/mdoc_markdown.c b/mdoc_markdown.c index bfa25a66..fcc63638 100644 --- a/mdoc_markdown.c +++ b/mdoc_markdown.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_markdown.c,v 1.27 2018/10/25 01:32:40 schwarze Exp $ */ +/* $Id: mdoc_markdown.c,v 1.28 2018/12/03 21:00:10 schwarze Exp $ */ /* * Copyright (c) 2017, 2018 Ingo Schwarze * @@ -19,6 +19,7 @@ #include #include #include +#include #include #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 */ @@ -722,6 +724,12 @@ md_cond_body(struct roff_node *n) return n->type == ROFFT_BODY; } +static int +md_pre_abort(struct roff_node *n) +{ + abort(); +} + static int md_pre_raw(struct roff_node *n) { -- cgit v1.2.3-56-ge451