source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: docbook2mdoc: no output for PARA right inside ENTRY, and fix the same in
Date: Fri, 22 Mar 2019 12:29:29 -0500 (EST)	[thread overview]
Message-ID: <e3fc93afa034ebac@fantadrom.bsd.lv> (raw)

Log Message:
-----------
no output for PARA right inside ENTRY, and fix the same in LISTITEM

Modified Files:
--------------
    docbook2mdoc:
        docbook2mdoc.c

Revision Data
-------------
Index: docbook2mdoc.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/docbook2mdoc.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.60 -r1.61
--- docbook2mdoc.c
+++ docbook2mdoc.c
@@ -720,15 +720,23 @@ pnode_printpara(struct parse *p, struct 
 	struct pnode	*pp;
 
 	assert(p->newln);
-	if (NULL == pn->parent || NODE_LISTITEM == pn->parent->node)
+	if ((pp = TAILQ_PREV(pn, pnodeq, child)) == NULL &&
+	    (pp = pn->parent) == NULL)
 		return;
 
-	pp = TAILQ_PREV(pn, pnodeq, child);
-	if (NULL == pp)
-		pp = pn->parent;
-	if ((NODE_SECTION != pp->node && NODE_PREFACE != pp->node) ||
-	    2 < p->level)
-		puts(".Pp");
+	switch (pp->node) {
+	case NODE_ENTRY:
+	case NODE_LISTITEM:
+		return;
+	case NODE_PREFACE:
+	case NODE_SECTION:
+		if (p->level < 3)
+			return;
+		break;
+	default:
+		break;
+	}
+	puts(".Pp");
 }
 
 /*
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

                 reply	other threads:[~2019-03-22 17:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e3fc93afa034ebac@fantadrom.bsd.lv \
    --to=schwarze@mandoc.bsd.lv \
    --cc=source@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).