aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--mdoc_markdown.c14
-rw-r--r--regress/mdoc/Eo/Makefile2
-rw-r--r--regress/mdoc/Eo/empty.out_markdown35
3 files changed, 41 insertions, 10 deletions
diff --git a/mdoc_markdown.c b/mdoc_markdown.c
index f6fb7fdf..8563e56a 100644
--- a/mdoc_markdown.c
+++ b/mdoc_markdown.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_markdown.c,v 1.6 2017/03/07 13:28:02 schwarze Exp $ */
+/* $Id: mdoc_markdown.c,v 1.7 2017/03/07 14:04:08 schwarze Exp $ */
/*
* Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -957,21 +957,17 @@ md_pre_Eo(struct roff_node *n)
static void
md_post_Eo(struct roff_node *n)
{
- int body, tail;
-
if (n->end != ENDBODY_NOT) {
outflags |= MD_spc;
return;
}
- body = n->child != NULL || n->parent->head->child != NULL;
- tail = n->parent->tail != NULL && n->parent->tail->child != NULL;
+ if (n->child == NULL && n->parent->head->child == NULL)
+ return;
- if (body && tail)
+ if (n->parent->tail != NULL && n->parent->tail->child != NULL)
outflags &= ~MD_spc;
- else if ( ! (body || tail))
- md_preword();
- else if ( ! tail)
+ else
outflags |= MD_spc;
}
diff --git a/regress/mdoc/Eo/Makefile b/regress/mdoc/Eo/Makefile
index c1c13b35..6fa9d843 100644
--- a/regress/mdoc/Eo/Makefile
+++ b/regress/mdoc/Eo/Makefile
@@ -2,7 +2,7 @@
REGRESS_TARGETS = break empty obsolete unclosed
LINT_TARGETS = break obsolete unclosed
-MARKDOWN_TARGETS = break obsolete unclosed
+MARKDOWN_TARGETS = break empty obsolete unclosed
# groff-1.22.3 defect:
# - When .Ec is missing, groff prints no page footer.
diff --git a/regress/mdoc/Eo/empty.out_markdown b/regress/mdoc/Eo/empty.out_markdown
new file mode 100644
index 00000000..e0ed0e9b
--- /dev/null
+++ b/regress/mdoc/Eo/empty.out_markdown
@@ -0,0 +1,35 @@
+EO-EMPTY(1) - General Commands Manual
+
+# NAME
+
+**Eo-empty** - empty implicit enclosure macros
+
+# DESCRIPTION
+
+completely empty
+closing only
+&gt;&gt;
+content only
+text
+opening only
+&lt;&lt;
+no opening
+text&gt;&gt;
+no content
+&lt;&lt;&gt;&gt;
+no closing
+&lt;&lt;text
+all
+&lt;&lt;text&gt;&gt;
+completely empty
+prefixclosing only
+prefix&gt;&gt;
+no opening
+prefixtext&gt;&gt;
+no closing
+&lt;&lt;prefix
+stray closing
+&gt;&gt;
+end of file
+
+OpenBSD - February 1, 2015