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 479efed2 for ; Fri, 23 Nov 2018 14:30:14 -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 1gQH9X-00014z-Al; Fri, 23 Nov 2018 20:30:12 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1gQH9V-0001o8-Rx; Fri, 23 Nov 2018 20:30:09 +0100 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1gQH9V-0005vp-OJ; Fri, 23 Nov 2018 20:30:09 +0100 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id 9f706b50; Fri, 23 Nov 2018 20:30:09 +0100 (CET) Date: Fri, 23 Nov 2018 20:30:09 +0100 From: Ingo Schwarze To: Pali Rohar Cc: discuss@mandoc.bsd.lv Subject: Re: Undesirable space after parenthesis in HTML output Message-ID: <20181123193009.GA7177@athene.usta.de> References: <20181105200300.rnllxci2uhfj5w47@pali> <20181122140807.GF35604@athene.usta.de> <20181122142428.icetmrw6zptlsb3c@pali> X-Mailinglist: mandoc-discuss Reply-To: discuss@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181122142428.icetmrw6zptlsb3c@pali> User-Agent: Mutt/1.8.0 (2017-02-23) Hi Pali, Pali Rohar wrote on Thu, Nov 22, 2018 at 03:24:28PM +0100: > $ printf "%s\ntest test test test test %s\n" \ > 'Name (\fItest@example.org\fR)' 'Name (\fItest@example.org\fR)' \ > | mandoc -T html > > I got following output: > >
Name (test@example.org) test test test test test > Name ( test@example.org)
> > > First Name is correct, second Name not. Ah. Yes, i can reproduce that on -current. It wasn't even related to parentheses. The bug simply caused output of whitespace in the middle of words when there were font escape sequences - though not always. Whether the bug hit depended on the spacing mode before the word containing the font escape, which made it a bit elusive. Fixed in the following commit. Thanks for reporting the bug, Ingo Log Message: ----------- When a font escape appears in the middle of a string, make sure it doesn't cause output of bogus whitespace. Fixing a bug reported by Pali dot Rohar at gmail dot com. Modified Files: -------------- mandoc: html.c Revision Data ------------- Index: html.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/html.c,v retrieving revision 1.242 retrieving revision 1.243 diff -Lhtml.c -Lhtml.c -u -p -r1.242 -r1.243 --- html.c +++ html.c @@ -416,8 +416,11 @@ print_encode(struct html *h, const char case ESCAPE_FONTBI: case ESCAPE_FONTCW: case ESCAPE_FONTROMAN: - if (0 == norecurse) + if (0 == norecurse) { + h->flags |= HTML_NOSPACE; print_metaf(h, esc); + h->flags &= ~HTML_NOSPACE; + } continue; case ESCAPE_SKIPCHAR: h->flags |= HTML_SKIPCHAR; -- To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv