summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-03-07 14:04:08 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-03-07 14:04:08 +0000
commit029687108c2a7a7bfad17ba05b13e003b6170b7e (patch)
tree16d68f31137e6592f13a6b60b5a519bd0d23ab34
parent2e1d9e80f2952398060e47e91fece447ebd4ac5c (diff)
downloadmandoc-029687108c2a7a7bfad17ba05b13e003b6170b7e.tar.gz
fix completely empty .Eo: no blank line wanted
-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
+&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