aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_markdown.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-12-03 21:00:10 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-12-03 21:00:10 +0000
commit820b4d56427ff6a0f1e3399ac7e4aea447dd5c20 (patch)
tree021019d37963c18cc8553ccaff918c1f9ea1441f /mdoc_markdown.c
parent17e67c5cb10de07302a0f0ad1a0da7af23788f98 (diff)
downloadmandoc-820b4d56427ff6a0f1e3399ac7e4aea447dd5c20.tar.gz
mandoc-820b4d56427ff6a0f1e3399ac7e4aea447dd5c20.tar.zst
mandoc-820b4d56427ff6a0f1e3399ac7e4aea447dd5c20.zip
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.c14
1 files changed, 11 insertions, 3 deletions
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 <schwarze@openbsd.org>
*
@@ -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;