summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdoc_markdown.c12
-rw-r--r--regress/mdoc/Eo/Makefile2
-rw-r--r--regress/mdoc/Eo/empty.out_markdown35
3 files changed, 40 insertions, 9 deletions
diff --git a/mdoc_markdown.c b/mdoc_markdown.c
index f14d66ce..ccbd8350 100644
--- a/mdoc_markdown.c
+++ b/mdoc_markdown.c
@@ -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
+>>
+content only
+text
+opening only
+<<
+no opening
+text>>
+no content
+<<>>
+no closing
+<<text
+all
+<<text>>
+completely empty
+prefixclosing only
+prefix>>
+no opening
+prefixtext>>
+no closing
+<<prefix
+stray closing
+>>
+end of file
+
+OpenBSD - February 1, 2015