source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: fix completely empty .Eo: no blank line wanted
@ 2017-03-07 14:04 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-03-07 14:04 UTC (permalink / raw)
  To: source

Log Message:
-----------
fix completely empty .Eo: no blank line wanted

Modified Files:
--------------
    mdocml:
        mdoc_markdown.c
    mdocml/regress/mdoc/Eo:
        Makefile

Added Files:
-----------
    mdocml/regress/mdoc/Eo:
        empty.out_markdown

Revision Data
-------------
Index: mdoc_markdown.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_markdown.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -Lmdoc_markdown.c -Lmdoc_markdown.c -u -p -r1.6 -r1.7
--- mdoc_markdown.c
+++ 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;
 }
 
Index: Makefile
===================================================================
RCS file: /home/cvs/mdocml/mdocml/regress/mdoc/Eo/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/mdoc/Eo/Makefile -Lregress/mdoc/Eo/Makefile -u -p -r1.2 -r1.3
--- regress/mdoc/Eo/Makefile
+++ 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.
--- /dev/null
+++ 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
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-07 14:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07 14:04 mdocml: fix completely empty .Eo: no blank line wanted schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).