From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout-kit-02.scc.kit.edu (scc-mailout-kit-02.scc.kit.edu [129.13.231.82]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 98715179 for ; Sun, 9 Apr 2017 16:22:51 -0500 (EST) Received: from asta-nat.asta.uni-karlsruhe.de ([172.22.63.82] helo=hekate.usta.de) by scc-mailout-kit-02.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1cxKIM-0006S4-20; Sun, 09 Apr 2017 23:22:51 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1cxKIJ-0001Dv-A0; Sun, 09 Apr 2017 23:22:47 +0200 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1cxKIJ-0001QX-5X; Sun, 09 Apr 2017 23:22:47 +0200 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id edf8e180; Sun, 9 Apr 2017 23:22:47 +0200 (CEST) Date: Sun, 9 Apr 2017 23:22:47 +0200 From: Ingo Schwarze To: "Anthony J. Bentley" Cc: tech@mdocml.bsd.lv Subject: Re: Groff difference: punctuation following Lk Message-ID: <20170409212247.GC76366@athene.usta.de> References: <80788.1491038992@cathet.us> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <80788.1491038992@cathet.us> User-Agent: Mutt/1.6.2 (2016-07-01) Hi Anthony, Anthony J. Bentley wrote on Sat, Apr 01, 2017 at 03:29:52AM -0600: > Consider the following mdoc(7) source: > > .Lk https://www.example.com/ . > > In mandoc(1), this gets rendered as: > https://www.example.com/. > > Doing the same with groff-1.22.3's nroff(1) yields: > > .: https://www.example.com/ That's an obvious bug in groff. > It (unexpectedly, to me at least) treats the period as the text of the > link, rather than punctuation that trails the macro. > > I guess mandoc's behavior is wrong, even though it makes more sense... I guess not. How do you like the following patch? The way the .Lk macro is implemented in groff indicates that mandoc's behaviour is intendet. Why would you do an explicit check against punctuation (the \n[doc-arg-type] < 3) unless you want to handle punctuation specially? Given the non-obvious calling conventions of doc-get-arg-type, it is prone to forgetting the necessary setup of doc-width, which seems to be what happened here... By the way, this improves the formatting of sendbug(1), whois(1), SSL_CTX_get_max_cert_list(3), acx(4), oce(4), and isakmpd.conf(5) with groff. If you like it, tell me and i'll submit a patch to the groff bugtracker and prepare a patch for the OpenBSD ports tree. Yours, Ingo diff --git a/tmac/doc.tmac-u b/tmac/doc.tmac-u index 8f9f90fb..71c68466 100644 --- a/tmac/doc.tmac-u +++ b/tmac/doc.tmac-u @@ -6454,6 +6454,7 @@ . ds doc-str-Lk Sy \$@ . . ie (\n[.$] > 1) \{\ +. doc-get-width "\$2" . doc-get-arg-type \$2 . ie (\n[doc-arg-type] < 3) \{\ . Em \)\$2: -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv