tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Stephen Gregoratto <dev@sgregoratto.me>
Cc: tech@mandoc.bsd.lv
Subject: Re: Parsing errors, output regressions with new XML parser
Date: Tue, 2 Apr 2019 18:50:35 +0200	[thread overview]
Message-ID: <20190402165035.GF6369@athene.usta.de> (raw)
In-Reply-To: <20190330001919.rrbc2xxrx47upalg@BlackBox>

Hi Stephen,

Stephen Gregoratto wrote on Sat, Mar 30, 2019 at 11:19:19AM +1100:

> -  There are regressions in how <author> and <citerefentry>
>    nodes are transformed. The example I pointed out previously:
> 
>   <author>
>     <personname>
>       <firstname>Joe</firstname>
>       <surname>Bloggs</surname>
>     </personname>
>     <email>joe@foo.net</email>
>   </author>
> 
>   Now converts to:
> 
>   .Dd $Mdocdate$
>   .Dt UNKNOWN 1
>   .Os
>   .Sh AUTHORS
>   .Nm foo
>   is maintained by
>   .An \&Joe Bloggs ,
>   .Aq Mt joe@foo.net
>   \&.

Fixing that was quite straightforward, see the commit below.

I also added a regression test based on your example to my regress/
directory, which is so far private.  But at some point, i will almost
certainly want to publish that; i didn't do that yet because making
Makefiles portable is a pain.  Are you comfortable with your
contributions being included under the ISC license (of course
including the correct Copyright notice with your name)?

 $ cat regress/author/email.{xml,out}        
<part>
  <!-- Copyright (c) 2019 Stephen Gregoratto -->
  <author>
    <affiliation>Placeholder Inc.</affiliation>
    <email>joe@foo.net</email>
    <personname>
      <firstname>Joe</firstname>
      <surname>Bloggs</surname>
    </personname>
  </author>
</part>
.An \&Joe Bloggs Aq Mt joe@foo.net ,
Placeholder Inc.

Thanks,
  Ingo


Log Message:
-----------
use the idiom ".An Name Aq Mt email" for author email addresses;
issue reported by Stephen Gregoratto <dev at sgregoratto dot me>

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

Revision Data
-------------
Index: docbook2mdoc.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/docbook2mdoc.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.79 -r1.80
--- docbook2mdoc.c
+++ docbook2mdoc.c
@@ -438,6 +438,16 @@ pnode_printauthor(struct format *f, stru
 	}
 
 	/*
+	 * If there is an email address,
+	 * print it on the same macro line.
+	 */
+
+	if ((nc = pnode_findfirst(n, NODE_EMAIL)) != NULL) {
+		pnode_print(f, nc);
+		pnode_unlink(nc);
+	}
+
+	/*
 	 * If there are still unprinted children, end the scope
 	 * with a comma.  Otherwise, leave the scope open in case
 	 * a text node follows that starts with closing punctuation.
--
 To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv

  parent reply	other threads:[~2019-04-02 16:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-30  0:19 Stephen Gregoratto
2019-04-02 13:16 ` Ingo Schwarze
2019-04-02 16:02 ` Ingo Schwarze
2019-04-02 16:50 ` Ingo Schwarze [this message]
2019-04-02 17:20 ` Ingo Schwarze
2019-04-02 17:48 ` Ingo Schwarze

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=20190402165035.GF6369@athene.usta.de \
    --to=schwarze@usta.de \
    --cc=dev@sgregoratto.me \
    --cc=tech@mandoc.bsd.lv \
    --subject='Re: Parsing errors, output regressions with new XML parser' \
    /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

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).